The substance may exist in various from A phase is any homogeneous form of substance that is solids, liquids and gases.
A pure substance is one that is homogeneous and invariable in chemical composition. It may exist is one or more phase but chemical composition remain the same in all phases.
Ex. Liquid water or solid (ice) or water vapour (steam) is a pure substance.
The mixture of gases such as atmospheric air comprising nitrogen and oxygen and other few gases such as carbon dioxide, the organ can be treated as pure substance as long as it remains gas.
Since it's chemical composition is constant. But if there is a change of phase like a mixture of gaseous and liquid air then it cannot be considered as a pure substance, because of the chemical composition of air in the liquid phase is different from that in the vapour phase. Liquid nitrogen and gaseous nitrogen mixture can be called pure substance.