Tristate operation means an input/output pin can be in one of three states: sourcing current, sinking current, or open-circuit. When in open-circuit mode, other devices that source or sink current can (one device at a time) drive the I/O line.
The STM32F407 is a very complicated microcontroller, unsuitable for the novice circuit designer. The best way to learn about this particular microcontroller is under the tutelage of another engineer who has a few years experience in its application and programming. You can download the datasheet
here, but based on your questions I doubt you will be able to make much sense of it.
Are you planning to build the STM32F407 into a project, or do you want to learn how to program it? There are evaluation boards available to help with either task.