What happens to make water change from a gas to a liquid?

The water vapor increases in temperature as the molecules speed up.
The water vapor increases in temperature as the molecules move apart.
The water vapor cools down as the molecules speed up.
The water vapor cools down as the molecules slow.

The water vapor cools down as the molecules move closer together.