A stable configuration usually consists of eight electrons in the outermost or valence shell. This observation leads to the octet rule:
In chemical bonding, atoms transfer or
share electrons to obtain outer shells with eight electrons.
The octet rule generally applies to all main-group elements except hydrogen, lithium, and beryllium. Each of these elements achieves stability when it has two electrons (a duet) in its outermost shell.