The correct option is B 2
We can use the cross method of finding the chemical formula and backtrack to find the valency of magnesium. First, we write down the elements as Mg and Cl and then we write down their valencies beneath them. Next, we interchange the valencies of Mg and Cl and write them as subscripts which gives us the chemical formula. By comparison with the formula MgCl2 and keeping in mind that valency of chlorine as 1, we find out that valency of magnesium is 2.