Renewable energy sources are gaining significant interest due to their potential to decrease pollution resulting from the utilization of fossil fuels for generating electricity that is environmentally friendly. In this study, an innovative combined cooling, heating, and power cycle that makes use of geothermal, solar, and wind energy was examined. The 100 residential units are investigated throughout the year by a number of different subsystems, including photovoltaic-thermal panel, Wind Turbine, Steam Turbines, Fuel Cells, Heat pumps, Reverse Osmosis, Electrolyzer, batteries, and a hydrogen storage tank. The model of six European cities "Marseille, Monaco, Montpellier, Naples, Perpignan and Rome" located in Italy and France was the subject of this research. Transient assessment and the response surface method were employed in this study's optimization in TRNSYS. With the help of design of experiments, a few simulation scenarios were created, and response surface method was then utilized to examine the outcomes. Based on the findings, the optimal system greatly decreased the yearly life cycle costs of the boiler, the thermal comfort rating, the overall cost of consuming electricity, and the cost of natural gas consumption. The results demonstrate that the suggested system efficiency is increased by the addition of hydrogen storage and battery, and that the employment of fuel cells and WTs stabilizes the system's power output at all times of the day and night. According to the findings, Montpellier was the best city in terms of electricity generation, cost, and natural gas usage. The total amount of energy generated by the urban system over the course of a year is 425690.937 kWh/year, of which 121217.314 kWh/year are sold to the grid and the remainder is used to power homes. The annual use of natural gas is 47547.706 m3/year, while the annual production of freshwater is 3756.07 m3/year. The findings of the optimization showed that Montpellier's system, which includes 185 solar panels and 6 wind turbines, performs better than other systems.