Valency is the combining capacity of an element.
The number of electrons present in the outermost shell are called the valence electrons and they determine the valency of the element.
A short-cut method is used to calculate valency :
If no. of valence electrons are less than or equal to 4:
valency = valence electrons
If no. of valence electrons are more than 4:
valency = 8 - valence electrons
So, for the given elements -
ElementAtomic no.Electronic configurationValencyLithium32, 11Beryllium42, 22Boron52, 33Carbon62, 44