Intermolecular forces of attraction hold the molecules together. These forces determine the physical properties of substances like melting and boiling points. There are five types of intermolecular forces: Hydrogen bonding, dipole-dipole interactions, ionic interactions, ion-dipole interactions and dispersion forces.
Hydrogen bonding is a stronger force of attraction between hydrogen atom and an electronegative atom (F, N, and O). So, water molecules exhibit hydrogen bonding.
In carbon dioxide molecules, although each C=O is polar the molecule as a whole will be non polar due to symmetry. Therefore, the only intermolecular forces in CO2 will be dispersion forces.
Hence, Hydrogen bonding exists between water molecules but not carbon dioxide molecules.