im learning the general concepts of how atoms react etc... and i was struggling on the concept of diatomic molecules and how they work.

For example, i understand how halogens would be diatomic, (through reacting with the other atom by sharing one electron...)
but, for example, how is nitrogen diatomic?

doesnt it need to share with another 3 atoms or so, in order to obtain a full valence shell ? how is that diatomic?

:N:::N:

N has 5 electrons, so two N atoms share their 10 electrons between them as in the above. Notice I have 10 electrons total but each nitrogen atom THINKS it has 8. The atoms make 16 (apparent) electrons out of 8 (real). Neat trick.