SO2 is a polar molecule while CO2 is nonpolar.
SO2 has two lone pairs so it is polar despite having two nonpolar bonds. On the other hand CO2 has polar bonds but it is non polar because the direction of electrons is symmetrical, thus leaving the molecule with no net polarity.