Structural stabilities of high‐pressure YMgHx phases (x=2−10,12,14$x = 2-10, 12, 14$, and 16) and their superconductivities are investigated by employing evolutionary‐algorithm‐based crystal search combined with first‐principles calculations. For predicted candidate structures of YMgHx, the convex hull and phonon analyses reveal seven stable and two metastable phases. For all the predicted phases, superconducting transition temperatures (Tc) are also predicted by using the McMillan formula. P4/mmm$P4/mmm$‐YMgH6 is found having Tc=76$T_\mathrm{c} = 76$ K at 300 GPa comparable to the boiling temperature of liquid nitrogen, and high‐Tc (≥77 K) being predicted for the H‐richer phases, P4/mmm$P4/mmm$‐YMgH8 (124 K at 300 GPa), Cmmm$Cmmm$‐YMgH12 (152 K at 250 GPa), and Fdtrue3¯m$Fd\bar{3}m$‐YMgH12 (190 K at 200 GPa), which possess clathrate structures composed of H14, H18, H24, and H24 cages, respectively. To elucidate why the H‐rich phases attain high‐Tc, electronic and phonon band structures as well as electron–phonon coupling strength are analyzed based on Eliashberg spectral functions. The clathrate structures exhibit both a larger H‐driven electronic density of states at the Fermi level and a denser H‐driven phonon density of states, correlating with larger EPC constants. These structural and chemical bonding analyses reveal that the highest‐Tc phase Fdtrue3¯m$Fd\bar{3}m$‐YMgH12 has H4 units formed in the sodalite cage.