Here we see the valence shells of oxygen and magnesium.
How will the electrons react to make a stable product?
1 electron will move from oxygen to magnesium.
2 electrons will move from oxygen to magnesium.
1 electron will move from magnesium to oxygen.
2 electrons will move from magnesium to oxygen.