2D MoS2 has been identified as a potential material for greenhouse gas (CO2, N2O, and CH4) sensing, however, the underlying principles are not well understood yet such knowledge may offer optimization opportunities for the development of superior devices. Using ab initio Density Functional Theory approach, selected dopants X (X= Cl, O, P, and Se) were judiciously introduced on 2D MoS2 and the response of the modified monolayer to the various greenhouse gases analyzed. The results showed that when the gas molecules are introduced within the periphery of the dopant site, the gases become adsorbed on the dopant with interactions that are characteristic of physisorption due to moderate adsorption energies. Based on the magnitude of adsorption energies, Cl, P, and O doped 2D MoS2 were found to be sensitive and selective to CO2, N2O and CH4 gas molecules respectively. Further, charge transfer analysis of CO2, and N2O adsorbed on Cl and P doped 2D MoS2 monolayer respectively, showed that these gas molecules gain electrons from the doped 2D MoS2 monolayer during adsorption, while CH4 molecule loses electrons to O doped 2D MoS2 surface. In addition, CO2, N2O, and CH4 gas molecules are desorbed from the surfaces of Cl, P, and O doped 2D MoS2 at 432 K, 438 K and 298 K respectively, thus rendering the modified monolayer re-usable detection of greenhouse gases. Cl doped 2D MoS2 monolayer showed superior performance in CO2 detection due to its fast recovery time and moderate thermal treatment temperature.Our results reveal that the competitive adsorption at the X doped 2D MoS2 surfaces between the analyte and the greenhouse gas present in the atmosphere induces a switching in surface conductance that can be related to the greenhouse gases concentration and can be detected electronically, thus disclosing the sensing mechanism and optimization route that can guide future experimental studies.