Valency is the number of electrons in its outermost shell.
Valency can also be defined as the number of electrons needed to complete the octet configuration or to fill the outermost shell.
It is the number of electrons of an atom which uses to combine with atoms of another element.
It is the combining power of an element.
In an atom, the valence electrons are the electrons that can be used in combining with other atoms. they are lying in the valance shells(orbitals of the outermost shell).
For example, Hydrogen has 1 electron, and its valency is one, one electron is needed to complete its outermost shell.
Sulphate ion
It is an ion of sulphur oxide carrying a double negative charge. accepts 2 electrons from others.
Total valency can be calculated by adding the valency of the sulphur and oxygen. S= +6, O= -2. Total valency= +6 + (4x-2) = +6-8 = -2