The Lewis dot diagram is a diagram showing the valence electrons and how these electrons are shared in a bond. The number of valence electrons can be identified by knowing the group they belong to in the periodic table.
Magnesium is in group II, so magnesium will have two valence electrons. Fluorine is in group VII, so it will have 7 valence electrons.
Therefore, the Lewis dot diagram will be:
The dots represent the valence electrons of fluorine. And the X's, the valence electrons of magnesium. In this case, the fluorine takes the electrons from the magnesium, forming an ionic bond.