If a single neuron can have thousands of synapses with other neurons, how do each neuron "knows" to which further neuron to send transmitters? i.e. selectivity
When a neuron fires an action potential, it doesn't "select" a target. It releases neurotransmitter (somewhat probabilistically, as vesicle release has a probability <1 at most synapses) to every cell it synapses on, all of the thousands you reference.
What is important for selectivity is the development of synapses, which are shaped by axon guidance cues and later by synaptic plasticity. All of this is laid down well before an action potential causes neurotransmitter release.
However, for almost all connections in the brain, a post-synaptic neuron won't fire due to the activity of a single pre-synaptic cell. Therefore, the selectivity in which neurons will fire an action potential is driven by the population of neurons that are previously active, not any one cell. Neurons that fire in the near future can be said to be determined by the combination of all the neurons firing in the recent past, including both excitatory and inhibitory neurons. This gives brains an incredible diversity of possible states. If we are to simplify neurons as "firing" or "not firing" in a given time window that would equal 2^(number of neurons) possible states, each leading to a different subsequent state.