Buildings play an important role in consumption of energy and carbon dioxide emissions all over the world. The optimum thickness of each insulation material of wall and roof of residential buildings depending on energy, environment, economy and exergy was determined in this study. For this purpose, an optimization model was established based on four different criteria: energy, environment, economics, and exergy. A function was defined containing these four criteria. It has been seen from the results that the optimum insulation thickness of the wall and roof depends on the weight coefficients of the energy, environment, economic and exergy parameters and insulation material types. The results of the economic analysis indicate that the optimum insulation thickness of wall varies from 1.01 to 7.7 cm and the optimum thicknesses of roof varies from 3.25 to 6.7 cm for XPS, EPS and Glasswool insulation materials. According to the results of the enviromental analysis, the optimum thicknesses of wall for different insulation materials are 6.5, 8.6, 9.4, and 9.55 cm and optimum insulation thicknesses of roof are 7.55, 8.1 and 8.2 cm, respectively. The effect of economic and energy parameters on the optimum thickness of the wall and roof for the three insulation materials was investigated using the sensitivity analysis method. It was seen from the results that impacts of interest rate, inflation rate, electricity cost, fuel cost, insulation material cost, heating and cooling degree-days on the optimum insulation thickness of wall and roof and 4EF optimization function were different.