Motivated by the recent experimental study on hydrogen storage in MXene multilayers [Liu et al., Nat. Nanotechnol. 16, 331 (2021)], for the first time we propose a workflow to computationally screen 23 857 compounds of MXene to explore the general relation between the activated H2 bond length and adsorption distance. By using density functional theory we generate a dataset to investigate the adsorption geometries of hydrogen on MXenes, based on which we train physics-informed atomistic line graph neural networks (ALIGNNs) to predict adsorption parameters. To fit the results, we further derived a formula that quantitatively reproduces the dependence of H2 bond length on the adsorption distance from MXenes within the framework of Pauling's resonating valence bond theory, revealing the impact of transition metal’s ligancy and valence on activating dihydrogen in H2 storage.