Valency = number of bonds
What is valency?
If the number of electrons in an atom’s outer shell is four or less, the valency of the atom is equal to the number of electrons in the outer shell.
For example, carbon has six electrons, two in the first shell, and four in the outer shell. This means that it has a valency of four.
If there are more than four electrons in the outer shell, the atom’s valency is equal to eight minus the number of electrons in the outer shell.
For instance, oxygen has eight electrons, two in the first shell and six in the outer shell, giving it a valency of two (8 - 6 = 2).
Because elements in the same group of the periodic table have the same number of valence electrons, they also have the same valency:
The noble gases (group 0) have a valency of 0 because, as they already have full outer electron shells, they do not need to gain or release electrons.
Elements in groups 1 and 7, however, have a valency of 1 because they are looking to lose or gain a single electron.
Because they have the same valency, elements from group 1 are likely to react with elements from group 7 to fill their outer shells and form ionic compounds.
Similarly, elements in group 2 are likely to bond with those in group 6, because they both have a valency of 2.
A lithium atom (group 1), will readily transfer its single valence electron to a fluorine atom (group 7), which has seven electrons in its outer shell. When the two atoms have bonded to form lithium fluoride, they will each have complete outer shells.
Lithium has lost an electron, and a positive lithium ion (Li+) has been created. Fluorine has gained an electron to form a negative fluoride ion (Fl-).
Because the two ions are oppositely charged (lithium is now positive and fluorine is negative), they are strongly attracted to each other like a magnet.
When magnesium atoms (group 2) react with oxygen atoms (group 6), their two valence electrons are transferred to the outer shells of the oxygen atoms to form magnesium oxide.
Magnesium loses two electrons to form a positive magnesium ion (Mg2+), while oxygen gains two electrons to form a negative oxide ion (O2-).
Because the magnesium is now positive and the oxygen is now negative, the two ions are strongly bonded together like magnets.