This is an ionic bond. Magnesium, found in group 2, has 2 valence electrons and needs to release them to become stable. Sulfur, found in group 16, has 6 valence electrons and takes two from magnesium to become stable.
I like to say, "Eight is Great," to help students remember that atoms need eight electrons in the valance (outer energy level) to be stable.
It could be shown as [Mg 2+] [S 2-]. The Mg would have no dots, and the S would have 8 around it, two on each side, top, and bottom. The dots would be drawn inside the brackets around the symbols. The 2+ and 2- should be smaller and towards the top.
Mg becomes more positive and the S becomes more negative because electrons are negatively charged.