To study the adsorption characteristics of CO, CO2, N2, O2, and their binary-components in lignite coal, reveal the influence of CO2 or N2 injection and air leakage on the desorption of CO in goafs, a lignite model (C206H206N2O44) was established, and the supercell structure was optimized under temperatures of 288.15-318.15 K for molecular simulation. Based on molecular dynamics, the Grand Canonical Monte Carlo method was used to simulate the adsorption characteristics and the Langmuir equation was used to fit the adsorption isotherms of gases. The results show that for single-components, the order of adsorption capacity is CO2 > CO > O2 > N2. For binary-components, the competitive adsorption capacities of CO2 and CO are approximate. In the low-pressure zone, the competitive adsorption capacity of CO2 is stronger than that of CO, and the CO is stronger than N2 or O2. From the simulation, it can be seen that CO2, N2 or O2 will occupy adsorption sites, causing CO desorption. Therefore, to prevent the desorption of the original CO in the goaf, it is not suitable to use CO2 or N2 injection for fire prevention, and the air leakage at the working faces need to be controlled.