Answer:
+2
Step-by-step explanation:
Magnesium has the following electron configuration: 1s^2 2s^2 2p^6 3s^2 or [Ne] 3s2.
You can see that Magnesium contains two electrons in its outermost orbit. It loses these 2 electrons during the chemical reaction and transitions to the closest stable noble gas form. It also generates the Mg2+ ion as it loses two electrons. It has an ionic charge of 2+ as a result.
I hope you now fully comprehend why magnesium has a 2+ charge.