On heating, HCL vapours emanate from the test tube and NH3 gas is generated from the solution on the glass rod. The ammonia gas and hydrogen chloride gas react together to form the salt ammonium chloride in gaseous state first. However, immediately because of the condensation process at room temperature, it is converted into a solid state, thus causing the white smoke. The chemical equation for this is as follows.
NH3 (g)+ HCl(g) ➡NH4Cl(s)
Ammonia + Hydrogen chloride ➡Ammonium chloride