Sulphur number 16 can gain 2 electrons or lose 2, 4 or 6 electrons.
Sulphur has a grown state electron configuration of
This is the same outer valance of Oxygen. This gives Sulphur two unpaired electrons in its outer shell. When joined to Oxygen or another element with a higher electron negativity than sulphur it can lose those two electrons resulting in a +2 charge.
When Sulphur is joined to an element with a lower electron negativity it can used the same two unpaired p electrons to bond resulting in a -2 charge. This would be sulphur's preferred state.
Since sulphur is in the third row it can hybridize its six valance electrons into the 3d orbitals resulting in an electron configuration
S=O Sulphur monoxide shows sulphur with a + 2 charge losing two electrons to Oxygen.
O=S=O Sulphur dioxide shows sulphur with a +4 charge losing four electrons to Oxygen
O= S =O (Sulfate ion -2) shows sulphur with a +6 charge losing all
O- six electrons to Oxygen.