The sum of the oxidation numbers in a compound must equal zero. In the compound hydrogen sulfide, H2S, the two hydrogen atoms have an oxidation number of +1, for a total of +2.
Therefore, the oxidation number of sulfur in the compound is -2, and the sum of the oxidation numbers is 0.