Capillary trapping of gas in porous media is important for many processes such as oil recovery and gas geo-sequestration. Foam can mitigate gravity override and viscous fingering of gas by reducing its relative permeability through gas trapping. However, there are limited studies dedicated to understanding how foam assists in gas trapping, the best mode of foam injection for trapping, and its application in geo-sequestration. This paper uses an initial–residual saturation analysis to investigate foam-assisted capillary trapping during the surfactant alternating gas (SAG) injection process in saline aquifers. More specifically, we studied the effects of pore geometric properties, in situ generated foam, and surfactant concentration on gas trapping efficiency and final residual gas saturation, Sgr. First, NMR surface relaxometry measurements were carried out on the rock samples to indicate the mean pore sizes of the rocks. A series of core flooding tests, equipped with resistivity measurements, were then conducted using single-cycle gas injection followed by water injection, water alternating gas (WAG), and SAG injection methods to identify which mode of injection results in the most trapped gas. The results showed that the SAG method had a better sweep efficiency and trapped more gas than other methods. The initial–residual (IR) gas saturation relationships from SAG data measured from several rock samples were then analyzed using Land’s trapping model. Gas trapping efficiency (indicated by Land’s coefficient, C) and residual gas were also found to increase in rocks with large average pore sizes and with increasing surfactant concentration. However, increasing the surfactant concentration above a certain limit did not cause further improvement in the trapping coefficient but only increased the Sgr. The results also showed that high values of surfactant concentrations might cause a slight reduction in the foam’s apparent viscosity, which then reduces the initial gas saturation, and consequently, Sgr. Finally, a linear relationship between the Sgr and the measured log mean of surface relaxation times (T2LM) was obtained, and two correlations were proposed. Therefore, the NMR measurements can be considered a reliable prediction method for Sgr in porous media.