Answer:
D
Step-by-step explanation:
The simple answer is the electrons in the outermost energy level.
Hydrogen has 1 electron in the outermost energy level.
Magnesium has 2 so this tells you that magnesium has a charge of 2
Oxygen has 6 oxygen has a charge of - 2
Fluorine has 7
For most elements, the electrons in the most outer ring determine the valence of the element.
Notice that the non metals work differently than the metals. Mg may have a charge of 2 and that is the number of electrons in the valence right.
Oxygen is a non metal it has a charge of - 2. It gets 6 electrons by subtracting the number of its charge from 8.