The interaction of metallic glasses (MGs) with hydrogen can trigger many interesting physical, chemical and mechanical phenomena. However, atomic-scale understanding is still lacking. In this work, molecular dynamics (MD) simulations are employed to study the atomic structure, mechanical properties and relaxation behaviors of H-doped Ni50Al50 MGs doped by two methods. The properties of H-doped MGs are determined not only by the hydrogen content but also by the doping method. When H atoms are doped into the molten state of samples, H atoms can fully diffuse and interact with metallic atoms, resulting in loose local atomic structures, homogeneous deformation and enhanced β relaxation. In contrast, when H atoms are doped into as-cast MGs, the H content is crucial in affecting the atomic structure and mechanical properties. A small number of H atoms has little influence on the elastic matrix, while the percolation of shear transformation zones (STZs) is hindered by H atoms, resulting in the delay of shear band (SB) formation and an insignificant change in the strength. However, a large number of H atoms can make the elastic matrix loose, leading to the decrease in strength and the transition of the deformation mode from SB to homogeneous deformation. The H effects on the elastic matrix and flow units are also applied to the dynamic relaxation. The deformability of H-doped Ni50Al50 MGs is enhanced by both H-doping methods; however, our results reveal that the mechanisms are different.