Each #"O"# atom has six valence electrons (represented by dots in the picture below), and each #"S"# atom has six valence electrons (represented by crosses).
Each #"O"# atom can get an octet of eight electrons by sharing electrons between #"S"# and #"O"#, as in the picture above.
Each pair of shared electrons is a covalent bond.
Thus, in #"SO"_2#, there are four covalent bonds between the #"S"# and #"O"# atoms.
Using atomic symbols, we could represent the formation of the covalent bonds as
#:stackrel(bb(. .))("O")color(red)(":") + :stackrel(bb(. .))("S"): + color(red)(":")stackrel(bb(. .))("O"): → :stackrel(bb(. .))("O")color(red)(":"):stackrel(bb(. .))("S"):color(red)(":")stackrel(bb(. .))("O"):#
Each #"O"# atom now has an octet of valence electrons.
The #"S"# atom has 12 valence electrons, but that's OK because #"S"# can violate the octet rule and have 10 or even 12 valence electrons.
Chemists often use a dash to represent a pair of electrons in a bond, so we could also represent the process as
#:stackrel(bb(. .))("O")color(red)(":") + :stackrel(bb(. .))("S"): + color(red)(":")stackrel(bb(. .))("O"): → :stackrel(bb(. .))("O")=stackrel(bb(. .))("S")=stackrel(bb(. .))("O"):#