Answer:
4.has gained two electrons
Step-by-step explanation:
There exist electrovalent bonding the compound MgS . In electrovalent bonding, there is a transfer of electrons from the metal to non-metal.
Magnesium atom has an atomic number 12 and its electron configuration is 2,8,2
Sulfur atom , a non-metal has atomic number of 16 and its electron configuration = 2,8,6
This means that magnesium as a metal needs to loose two electrons from its valence shell to attain its stable structure.Also sulfur requires two more electron to achieve its octet structure.
Hence a transfer of electrons will take place from magnesium atom to sulfur atom, sulfur gaining two electrons.