Why is the chemical formula of sulphur dioxide is SO2?

Why is the chemical formula of sulphur dioxide is SO2 ?

Sulphur dioxide is a covalent compound not an ionic compound. Sulphur can have oxidation state of +2,+4 and +6. In Sulphur dioxide molecule S in +4 oxidation state and valency of oxygen is 2

So after criss cross and simplifying the formula is SO2