This happens when a main- group atom shares enough electrons to achieve a rare gas valence shell. Nitrogen molecules are an example of this situation.
Nitrogen atoms have five valence electrons.
We know that molecules of N 2 exist based on a great deal of measurements. If two nitrogen atoms simply formed a single bond the dot structure would look like the illustraton below. Each nitrogen atom would have only six electrons not an octet. The single bond doesn't provide the two nitrogen atoms with an octet. If the octet rule is to be followed, the nitrogen atoms must share more than two electrons.