A gas is a substance which takes the shape of its container and expands to completely fill it's container. There are several types of gases with slightly different behaviors. These are ideal gasses, real gasses, super critical fluids, plasmas and critical opalescent materials. This behavior is described mathematically by the ideal gas law. Although no gas behaves exactly as an ideal gas, many substances come very close to ideal behavior at atmospheric pressure and most behave ideally at very low pressures.
Most molecules attract one another until they come very close together, when they become repulsive.
This attraction is due to the electrostatic interactions between the two molecules. These interactions are often categorized into dispersion forces, van der Waals forces, hydrogen bonding and dipole-dipole interactions. The repulsion between molecules at very close distances is due to the repulsion between the nuclei of the two molecules. These forces give rise to relationships between the pressure, temperature, volume and quantity of a substance which do not exactly obey the ideal gas law. Gasses under physical conditions which give non-ideal behavior are called real gasses.