Heat from the Earth's core and radiation from the Sun is transferred to the surface of the Earth by conduction. Contact of the atmosphere with these warm surfaces transfers thermal energy, which then heats up the rest of the air through convection.
The atmosphere is also slightly heated by absorption of electromagnetic radiation from the Sun. The warm land and water radiates infrared, some of which is absorbed by the atmosphere, adding to its thermal energy. The remaining heat on the surface is sent out into space in the form of infrared radiation.
The lowest one would have the least amount of energy
Some common elements that are gaseous state at room temperature are:
Oxygen
Nitorgen
Fluorine
Chlorine
Hydrogen
Helium
In addition, all of the elements in group VIII are gases too, they have an octet of electrons (complete outer electron shell) , they're really stable and therefore they're called noble gases. Some examples from group VIII include helium, krypton, xenon etc.
Substance exist as gases in room temperature is due to their boiling point, where is it lower than the room temperature (usually around 25°C). If their boiling point is higher than room temperature, they should exist as either solid or liquid, which is how the majority of the elements in the periodic table is.