Inherent obstacles of hydrogen injection encompass preferential channeling through larger pathways, hampering microscopic sweep efficiency within porous media. This work pioneers hydrogen foam generation via co-injection with aqueous sodium dodecyl sulfate (SDS) to enhance subsurface hydrogen trapping capacity. SDS addition substantially reduces hydrogen-water interfacial tension and enhances viscoelasticity. In contrast to robust hydrogen foam stability, CO2 foams display compromised integrity, stemming from surfactant aggregation and ensuing infiltration channels that permit aqueous phase CO2 dissolution. Hydrogen foams conversely sustain uniform surfactant films, forestalling hydrogen ingress into water. Synergetic microfluidic and pore-scale simulations visualise mechanisms underlying intensified hydrogen capture and mobility reduction attributed to deformation and flow resistance when traversing constricted pores. Introducing the amphiphilic SDS surfactant considerably promotes hydrogen adsorption through its hydrophobic tail. Core flooding experiments quantify over 2 times hydrogen storage ratio amplification with SDS relative to sole hydrogen injection. The framework contributes pragmatic strategies to harness high-efficiency hydrogen foam for scalable clean energy storage.