Question: how many electrons will fluorine gain or lose in forming an ion?
Answer: Mg most commonly forms a 2+ ion. This is because Mg has two valence electrons and it would like to get rid of those two ions to obey the octet rule. Fluorine has seven valence electrons and as such, usually forms the F– ion because it gains one electron to satisfy the octet rule.