Air has density and volume and when the air gets heated up, air molecules have high energy and molecules of air start moving which results in an increase in distance between air molecules.
The density of the gas is the ratio of the mass of gas by volume of gas,
The volume of a gas is inversely proportional to density and the mass is directly proportional to the density.
Hot air molecules have more heat energy, as molecules have more energy there is an increase in the distance between molecules.
As the distance between molecules increases, the volume also increases.
Since volume is inversely proportional to the density, as the volume increases the density will decrease.
Less dense air floats over more dense air so hot air is lighter than cold air.