Valency is the combining capacity of the element. Valency is also known as valence number, is the number of valence bonds, a given atom has formed, or can form, with one or more other atoms.
Valency is the number of outermost electrons for the given element.
If the number of valence electrons ≤4: valency = number of valence electrons
If the number of valence electrons >4: valency = (8 - number of valence electrons)
Example: Nitrogen atom: Number of valence electrons (outermost electrons) = 5, so Valency = (8-5) = 3, so valency of N = +3.