The number of electrons in an atoms outermost valence shell governs its bonding behaviour.
Elements whose atoms have the same number of valence electrons are grouped together in the Periodic Table. Generally, elements in Groups 1, 2, and 13 to 17 tend to react to form a closed shell with the electron configuration s²p⁶.