Accurate intermolecular potential-energy surfaces (IPESs) for the ground and first excited states of the Sr-H2 and Yb-H2 complexes were calculated. After an extensive methodological study, the coupled cluster with single, double, and non-iterative triple excitation method with the Douglas-Kroll-Hess Hamiltonian and correlation-consistent basis sets of triple-ζ quality extended with 2 sets of diffuse functions and a set of midbond functions were chosen. The obtained ground-state IPESs are similar in both complexes, being relatively isotropic with two minima and two transition states (equivalent by symmetry). The global minima correspond to the collinear geometries with R = 5.45 and 5.10 Å and energies of -27.7 and -31.7 cm-1 for the Sr-H2 and Yb-H2 systems, respectively. The calculated surfaces for the Sr(3P)-H2 and Yb(3P)-H2 states are deeper and more anisotropic, and they exhibit similar patterns within both complexes. The deepest surfaces, where the singly occupied p-orbital of the metal atom is perpendicular to the intermolecular axis, are characterised by the global minima of ca. -2053 and -2260 cm-1 in the T-shape geometries at R = 2.41 and 2.29 Å for Sr-H2 and Yb-H2, respectively. Additional calculations for the complexes of Sr and Yb with the He atom revealed a similar, strong dependence of the interaction energy on the orientation of the p-orbital in the Sr(3P)-He and Yb(3P)-He states.