It is of great significance to study the stability of foams in the petroleum industry. Therefore, the stability mechanism of Span 20, the fluorinated surfactant FCO-80 and their compound system FS in a CO2 oil-based foam system was studied by molecular simulation. The sandwich model of CO2 oil-based foam was constructed to reveal the stability of the foam system from the microscopic perspective. The result shows that the oil-CO2 distance of the FS foam system is 16.087 Å, and the coordination number of oil molecules is 2.65. The diffusion coefficient of CO2 in the FS foam system is 3.94×10-6 cm2/s. This shows that under the synergistic effect of Span 20 and FCO-80, the diffusion coefficients of CO2 molecules are small, and the surface tension is reduced, which can improve the stability of foam. The results can supplement previous experimental results on the stability of oil-based foam.