The valency of magnesium and chlorine in magnesium chloride is:
Magnesium 2 and chlorine 1
Magnesium (Atomic number = 12) has electronic configuration 2, 8, 2. It loses 2 electrons to complete octet configuration in its valence shell. Chlorine (Atomic number = 17) has electronic configuration 2, 8, 7. It gains 1 electron to complete octet configuration in its valence shell.