During the critical period of development of the central nervous system, synaptic connections are first excessively generated and then reduced gradually via selective synaptic pruning. However, the rule how select the target synapses of pruning remains incompletely known. The candidate mechanisms include the Hebb‘s rule, which suggests that synaptic connections between neurons that fire synchronously would survive from developmental pruning. To experimentally verify this well-known theory, we developed a new method that enables to induce synchronous firing in in vivo layer 2/3 neurons of the mouse somatosensory cortex that sparsely expressed channelrhodopsin2 (ChR2) through in utero electroporation. We transcranially stimulated ChR2-positive neurons on postnatal days 9-to-13 and measured the connection probability between these neurons using in vitro patch-clamp recordings on postnatal days 21-to-28. The neocortex that received chronic photostimulation exhibited higher probabilities of synaptic connections between ChR2-positive neurons, compared to non-stimulated neocortex. The results are consistent with the Hebb‘s rule.