Step 1: Understand what valency means. Valency is the ability of an atom to bond with other atoms, usually determined by the number of electrons it can lose, gain, or share.
Step 2: Look at the position of Magnesium in the periodic table. Magnesium is in Group 2.
Step 3: Know that elements in Group 2 have 2 electrons in their outer shell.
Step 4: Realize that Magnesium can lose these 2 outer electrons to achieve a stable electron configuration.
Step 5: Conclude that since Magnesium can lose 2 electrons, its valency is 2.