system
Given the following post, respond as if you're commenting on Reddit:
human
What makes a gas a greenhouse gas? For example, what are the molecular properties of carbon dioxide (CO2) that allow it to retain heat, that nitrogen (N2) lacks?
gpt
Greenhouse gases absorb and re-emit infrared radiation. This means that instead of passing through the atmosphere and directly into space, some of the infrared radiation is re-emitted back toward the surface of the earth, increasing the net heat on the planet's surface.  If it were re-emitted in the same direction that would be no problem, but the absorption and re-emission randomizes the direction of the light, effectively bouncing some of it back to the ground. Like a greenhouse does, hence "greenhouse effect". 

The molecular property you're looking for is frequencies of vibration. The ability to absorb and re-emit infrared comes from a molecule that has a change in energy of vibration frequencies that corresponds to infrared energies. They absorb the photon, vibrate at a higher frequency, and re-emit that photon as they return to their less energetic state. Vibration frequencies are characteristic to each molecule, and in fact are often used as an analytical tool to identify unknown ones. So, the gases with vibration frequencies that can be perturbed by infrared radiation are greenhouse gases while gases like nitrogen, oxygen, and argon are not.