The Theory of Porous Media (TPM) has served as a reliable theory to deduce governing equations for unsaturated soils. In most works, the unsaturated soil is considered as a three-phase medium composed of air, water and solid. This neglects effects caused by the presence of residual water and/or entrapped (immobile) air attached to the particles. In this work, a set of governing equations for unsaturated soils with residual water and entrapped air is deduced. A mass transfer mechanism between the free air and the entrapped air is considered. The present work focuses only on the entrapped air attached to the particles (immobile air), and therefore it is assumed to have the same intrinsic velocity as the solid. This assumption allows to keep the same number of independent kinematic variables as in conventional three-phase theories. The performance of the theory is examined in simulations of water retention curves subjected to suction cycles, as well as in the dynamic analysis of a centrifuge test on a dam subjected to earthquake loading.