The capacity of an element to combine or bond with other elements like sodium Na+ has a valency of 1 as its outermost shell has 7 electrons whereas it has the maximum capacity of 8 electrons in valence shell it needs one extra electron to become chemically inactive
Valency is the last shell of atom. number of electrons in last shell are called valency electrons.
For example oxygen atomic number is 8. In first shell it has 2electrons. And shell it has 6electrons
I.e 2 electrons in S-orbital and 4 electrons in P-orbital
so it's valency is 6