Magnesium oxide is an ionic compound. Its formula unit (MgO) is made from one magnesium atom, which loses two electrons to become a +2 cation, and one oxygen atom, which gains those two electrons to become a -2 anion.
The Lewis Structure can show the transfer of electrons from metal (low electronegativity) to non-metal (high electronegativity). Observe below.
You can watch this getting drawn in the video below.
Magnesium oxide does not hybridize to do this, so if you’re looking for the molecular shape, it does not exist. Remember, ionic compounds are crystal lattices, which means the ions (Mg+2 and O-2) surround each other and hold together with ionic bonds. It crystallizes in a face-centred cubic structure, which has an octahedral coordination geometry – each Mg+2 is surrounded by six O-2 ions, and each O-2 ion is likewise surrounded by six Mg+2 ions.