Answer:
Both electrons of Mg should be transferred to one O.
Step-by-step explanation:
This is because metals like to lose electrons whereas non metals like to gain electrons in an ionic compound. MgO is an ionic compounds. So Magnesium being a metal in group 2 of periodic table, it wants to donate 2 electrons to get to the octet rule, so it donates its electrons and oxygen accepts them to fill its octet rule.