Valency can be simply defined as the number of Hydrogen atoms that an element can combine with. In the above table, Helium, Neon and Argon have a valency of 0. They do not normally form compounds.
Lithium, Sodium and Potasium have a valency of 1 because they combine with one Hydrogen atom. Beryllium, Magnesium and Calcium all have a valency of 2: they combine with two Hydrogen atoms. Note that the valences of all these atoms are equal to the number of outer electrons that these elements have.
Boron and Aluminium combine with three Hydrogen atoms - their valences are 3 - and they have three outer electrons.
Carbon and Silicon combine with four Hydrogen atoms. The valency of these elements is 4. It will come as no surprise that they both have four outer electrons.
What about Nitrogen and Phosphorus? They have five outer electrons. But they normally only combine with three Hydrogen atoms. Their valences are 3. Note that 3 is 5 less that 8. These atoms are three electrons short of a full shell.
Please note that both Nitrogen and Phosphorus can also have a valency of 5. Some atoms are capable of having more than one valency. That will confuse the issue so I will talk of normal valency.
Now to Oxygen and Sulphur. Both have six outer electrons. Six is two short of a full shell. Their normal valences are 2 and they combine with two atoms of Hydrogen. Water is H2O! Sulphur can also have a valency of 6 (or even 4) in some of its compounds.
Finally, Fluorine and Chlorine - seven outer electrons. This is one short of a full shell. They both combine with a single Hydrogen atom and their normal valences are 1.
As a side note, Chlorine can also have valences of 3, 5 and 7. The reasons are well beyond the scope of this introductory essay.
The rules above can be summarised as follows:
The normal valency of an atom is equal to the number of outer electrons if that number is four or less. Otherwise, the valency is equal to 8 minus the number of outer electrons.
The atoms with full electron shells (Helium, Neon, Argon) are chemically inert forming few compounds. The atoms don't even interact with each other very much. These elements are gases with very low boiling points.
The atoms with a single outer electron or a single missing electron are all highly reactive. Sodium is more reactive than Magnesium. Chlorine is more reactive that Oxygen. Generally speaking, the closer an atom is to having a full electron shell, the more reactive it is. Atoms with one outer electron are more reactive than those with two outer electrons, etc. Atoms that are one electron short of a full shell are more reactive than those that are two short.
The next two sections will discuss exactly how atoms combine together.