What is the correct Lewis structure of diazomethane?
The image above depicts three mesomeric structures of diazomethane ($\ce{CH2N2}$). When you count the valence electrons for every atom, you will find that only the left and middle structure satisfy the octet / duet (for hydrogen) rule, i.e. that every $\ce{C}$ and $\ce{N}$ atom has 8 valence electrons, and every $\ce{H}$ has two valence electrons. The structure on the right side does not obey the octet / duet rule because the positively-charged nitrogen only has an electron sextet. The same is true for the two structures you have drawn with an $\ce{N-N}$ single bond. In both cases, at least one nitrogen has only 6 valence electrons.