the "half reactions" work in the same way:
x H2S --> y S8 + z H+ + n e-
oxidation state of S goes from -2 to 0, as you indicated, so 2 electrons transfered per sulfur
this gives:
n = 2x (this is what you were required to do)
then you have 8 sulfur after the arrow, so:
x = 8y
then, for each H2S, you have 2 protons after the arrow, so:
z = 2x
n = z = 2x = 16y
so the simplest form: y = 1, then x = 8 and n = z = 16
gives:
8 H2S --> 1 S8 + 16 H+ + 16 e-
if you want to do this in the main reaction, it works similar, but then the oxidation state change is less defined.