Sulphur cannot have a lone pair in the presence of oxygen
What do you mean? If you draw the Lewis structure you can see that DMSO, along with all sulfoxides, has a lone pair on sulfur.
how do you tell that the double bonds is going to between N and O ,instead of having lone pair on N?
So the possibilites if you keep a lone pair on N are:
..
1. Me-N-O
- |
O
+ ..
2. Me-N-O
. |
O
.As Rabn said, consider the electronegativity of O. in the case of 1, we have an O atom with only 6 electrons, and in the diradical 2 we have two O atoms with 7 electrons each. These would be very unstable structures, O is very electronegative so it will pick up a full octet if it can.
If we look back at structure 1, you might see that if we use the lone pair on N to donate into the positively charged O then we satisfy the octet for O.
.. +
1. Me-N-O
- <-----> 3. Me-N-O
- | ll
O
+ O
So 3 is a much more stable resonance structure, and closer to the truth.