Hydrodynamic simulations of the Disc of Gas Around Supermassive black holes (HDGAS): II. The transition from neutral atomic to molecular gas phases