J.R. S. answered 02/28/21
Ph.D. University Professor with 10+ years Tutoring Experience
Magnesium has 2 valence electrons which it will gladly give away to become Mg2+
Fluorine has 7 valence electrons and wants 1 more to complete the octet and make it stable. It becomes F-
So, if you have 2 fluorines, each one can take an electron from the Mg and you end up with
Mg2+ and 2F- The bonding might be written or described as follows:
[F-] [Mg2+] [F-] to represent the magnesium fluoride salt, MgF2