What is the oxidation state of sulphur in sulphur dioxide?
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^-}$