Energy level occupied by electrons
The outermost shell determines bonding
Electrons occupy shells around the nucleus, each at a different energy level. The first shell holds up to two electrons, the second up to eight, and the third up to 18. The outermost occupied shell is the valence shell, and its electrons, the valence electrons, take part in chemical bonds. Atoms tend to complete their valence shell by sharing, gaining, or losing electrons, which is why carbon usually forms four covalent bonds and oxygen two.