The hybridization of multiple energy sources improves the system efficiency and the reliability of the supply than single-source generators. This article presents a multi-objective optimization of developed multiple sources consisting of solar and wind turbine systems, micro-gas turbine and battery energy storage. This optimization technique is based on the use of a metaheuristic method as Harmony Search Algorithm to solve the optimization problem, taking into account a control of energy management of the hybrid configuration system, supply a residence load (e.g., buildings) located in Turkey. The applied method allows to minimize the total system cost and the emission of the carbon dioxide. A comparative study has been analyzed for different configuration systems based on the suggested hybrid system to select the optimal solution about the cost, the sizing and the reduction in the CO2 emission. The simulation results, obtained under MATLAB environment, demonstrated that the optimal configuration system is selected by the proposed hybrid (PV/wind/micro-gas turbine/battery) energy system. The improved algorithm by Global Dynamic Harmony Search method has better efficacy and proves its performance in the optimization process as it converges faster than other tested methods with a better running time.