Read · 2 min
An atom will tend to lose electrons if it has few valence electrons. For example, on the periodic table, the group 1 and 2 elements tend to lose electrons and form ionic bonds. That's the alkali and alkaline earth metals. Why? They want to achieve the electron configuration of the preceding noble gas. An atom will gain electrons if it is close to a full octet. For example, the halogens tend to gain 1 electron and achieve an octet. Atoms that have at least 3 valence electrons tend to share electrons. So, the metalloids and nonmetals will form covalent compounds. When atoms share electrons, each atom effectively gains 1 electron.
There are 3 notable exceptions to the octet rule for the main group elements. Hydrogen and helium both want 2 electrons. This is because they only have access to the subshell, which can only contain 2 electrons. By extension, lithium and beryllium tend to form ions with a 1+ and 2+ charge respectively. So they also end up with only 2 electrons. The third notable exception is boron. Boron wants 6 electrons. This is because boron tends to share electrons rather than give or take. An atom can only share as many electrons as it has in its valence shell. So, boron can only share three electrons. This leaves boron with a total of 6.
As a side note, sometimes you will see boron with four bonds. But, that only happens when a ligand donates an electron pair. So, the boron doesn't contribute any electrons to the fourth bond.
The other exception to the octet rule is the transition metals. They have access to the d-orbitals. So, their valence shell would hold 18 electrons. But, generally, they don't require a full valence shell because they have various oxidation states.
