Our nervous system is organized into circuits with specifically matched and tuned cell-to-cell connections that are essential for proper function. The mechanisms by which presynaptic axon terminals and postsynaptic dendrites recognize each other and establish the correct number of connections are still incompletely understood. Sperry's chemoaffinity hypothesis proposes that pre- and postsynaptic partners express specific combinations of molecules that enable them to recognize each other. Alternatively, Peters' rule proposes that presynaptic axons and postsynaptic dendrites use non-partner-derived global positional cues to independently reach their target area, and once there they randomly connect with any available neuron. These connections can then be further refined by additional mechanisms based on synaptic activity. We used the tractable genetic model system, the Drosophila embryo and larva, to test these hypotheses and elucidate the roles of 1) global positional cues, 2) partner-derived cues and 3) synaptic activity in the establishment of selective connections in the developing nerve cord. We altered the position or activity of presynaptic partners and analyzed the effect of these manipulations on the number of synapses with specific postsynaptic partners, strength of functional connections, and behavior controlled by these neurons. For this purpose, we combined 2 developmental live imaging, electron microscopy reconstruction of circuits, functional imaging of neuronal activity, and behavioral experiments in wildtype and experimental animals. We found that postsynaptic dendrites are able to find, recognize, and connect to their presynaptic partners even when these have been shifted to ectopic locations through the overexpression of receptors for midline guidance cues. This suggests that neurons use partner-derived cues that allow them to identify and connect to each other. However, while partner-derived cues are sufficient for recognition between specific partners and establishment of connections;; without orderly positioning of axon terminals by positional cues and without synaptic activity during embryonic development, the numbers of functional connections are altered with significant consequences for behavior. Thus, multiple mechanisms including global positional cues, partner-derived cues, and synaptic activity contribute to proper circuit assembly in the developing Drosophila nerve cord.