Magnesium (Mg) has two electrons in its outermost energy level.
Oxygen (O) has six. How can a Mg atom bond with an O atom?