The correct option is B Magnesium and Aluminium
Valency is defined as the combining capacity of an element. Magnesium has two electrons in its outermost shell and aluminium has three electrons. Mg loses 2 electrons to attain their nearest noble gas configuration while Al loses 3 electrons to attain their nearest noble gas configuration. Hence, valency of Mg and Al are 2 and 3 respectively.
Helium has only 2 electrons which is in its K-shell. Lithium has a total of 3 electrons in which only 1 electron is in the valence shell. The valency of lithium is 1 as it loses 1 electron to attain stability.