What is the oxidation state of sulphur in sulphur dioxide? So for $\ce{SO2}$, here's the solution when finding for the oxidation number of sulfur.

$$x + 2(-2) = 0 \\
x - 4 = 0 \\ 
x = +4$$

$x$ here would be the oxidation number of sulfur, so the compound would now be 
$\overset{+4}{\ce S} \overset{-2}{\ce{O2}}$.

Now if I tried using oxygen as the $x$ it would become: 
$$1(-2) + 2x = 0 \\ 
-2 + 2x = 0 \\
2x = 2 \\
\frac{2x}{2} = \frac 22 \\
x=1$$

So, in this case the compound would actually be $\overset{-2}{\ce S} \overset{+1}{\ce{O2}}$.

I'm pretty confused about this since we just got into this today and haven't checked many examples. There is probably something I'm missing in the solution or a rule. Can someone explain to me the correct one? And also can't sulfur's and oxygen's oxidation number both be -2 as they're in group VI(A)?
Your teacher used an interesting example that doesn't obey the rules cleanly. Sulfur can have many oxidation states in this method. In general, larger elements can have oxidation states different than suggested by the group they are in.  

If you have learned the electronegativity rules yet, here is a good place to use. If you haven't, higher electronegativity basically means that the element has stronger driving force to reaching an octet; you can look up an electronegativity table if you like. The more electronegative element takes the electrons first. So, in your example, $\ce{SO2}$ has $\ce{2O^2-}$, because of the group oxygen is in. Then, because the $\ce{SO2}$ is neutral, there must be a $\ce{S^4+}$.  

But, in a compound such as $\ce{Na2S}$, you can see that S is closer to reaching an octet than Na. So, this becomes $\ce{S^2-}$ while each sodium become $\ce{Na+}$.  

Try finding the oxidation states (numbers) for $\ce{PF5}, \ce{WO3}, \ce{SOCl2}$ for understanding. Solutions in the spoiler below.


   $\ce{PF5~is~P^5+,5F-}$
 $\ce{WO3~is~W^6+,3O^2-}$
 $\ce{SOCl2~is~ S^4+, O^2-, 2Cl^-}$