There are two conditions for liquefaction of gases. There are-

  1. By applying pressure
  2. By decreasing temperature

By Applying Pressure: At high pressure the volume of gas decreases Therefore, the molecules of gas come close to each other due to which there is intermolecular attraction between molecules. In this way if we apply define amount of pressure then for some gases intermolecular attraction force reaches such a extent so that gas turns into liquid.

By decreasing temperature: According to kinetic theory of gases if the temperature is decreased kinetic energy of molecules also decreases and at the same time volume of gas also decreases. The molecules which come close to each other at low temperature cannot resist intermolecular attraction of each other. Therefore the gas turns into liquid due to this attraction force.