Here's the key:
* Elements in their pure elemental form have an oxidation number of 0.
This is because the atoms are not bonded to any other element, and therefore there is no electron transfer or sharing.
Therefore, the oxidation number of S in S2 is 0.