Only the electrons in the outer shell (n = 2) are shown.
From this figure, we see that if the atoms ``share'' their
electrons in the manner indicated, then, at times, each
atom will have a filled n = 2 shell with 8 electrons.
This sharing of electrons
between atoms can be viewed in light of the Heisenberg uncertainty
relations, which says that it is impossible in principle to
say where precisely an electron is located.
Such a configuration is
energetically favoured, as this molecule is less likely to
interact with other atoms and is therefore more stable,
and for this reason these
valence bonds occur quite
frequently in nature.