Different elements have different number of electrons in the outermost or the valence shell. These electrons in the outermost shell are known as valence electrons. The number of valence electrons determines the combining capacity of an atom in an element.
Valence is the number of chemical bonds that an atom can form with univalent atoms. Since hydrogen is a univalent atom, the valence of an element can be taken by the number of atoms of hydrogen with which one atom of the element can combine. For example, in H2O, NH3, and CH4 the valencies of oxygen, nitrogen and carbon are 2, 3 and 4 respectively.
The elements having a completely filled outermost shell in their atoms show little or no chemical activity. In other words, their combining capacity or valency is zero. The elements with completely filled valence shells are said to have stable electronic configuration. The main group elements can have a maximum of eight electrons in their valence shell. This is called octet rule. The combining capacity or the tendency of an atom to react with other atoms to form molecules depends on the ease with which it can achieve octet in its outermost shell.
The valencies of the elements can be calculated from the electronic configuration by applying the octet rule.
Valency = Number of valence electrons (for 4 or lesser valence electrons)
Valency = 8 - Number of valence electrons (for more than 4 valence electrons)