The combining capacity of an atom is known as its valency.
The number of bonds that an atom can form as part of a compound is expressed by the valency of the element.
Valency is simply equal to the number of electrons gained, lost, or shared by an atom of an element to achieve the nearest noble gas configuration. For example, the valency of sodium (Na) is 1, magnesium (Mg) is 2, Chlorine (Cl) is 1, etc.
The valencies of the elements belonging to the s-block and the p-block of the periodic table are generally calculated as the number of valence electrons or eight minus the number of valence electrons.
For the d-block and f-block elements, valency is determined not only on the basis of valence electrons but also on d and f orbital electrons.
However, the general valencies of these d and f block elements are 2 and 3.