Valency is the combining capacity of an element. It is determined by the number of valence electrons.
If number of valence electrons are four or less than four, then
Valency = number of valence electrons
If number of valence electrons are greater than four, then
Valency = 8 - number of valence electrons
ElementAtomic numberElectronic configurationValencyHydrogen1(1)1Boron5(2,3)3Neon10(2,8)0Magnesium12(2,8,2)2
Hence, the descending order of the given elements depending on their valency is:
Boron > Magnesium > Hydrogen > Neon.