CO2 is non-polar while SO2 is polar in nature. The geometry of co2 is linear which makes the dipole moments of both its bonds cancel out. The geometry of so2 is bent which means that the dipole moments of each bond do not cancel each other out, resulting in a net dipole moment and thus resulting in polarity.