A novel multigeneration energy system encompassing a two-stage water purification unit, high-temperature solid oxide electrolysis cell (SOEC), heliostat solar field, and power generation cycles including organic and two-stage steam Rankine cycles is introduced in this study. The two-stage desalination system comprises humidification, dehumidification, and reverse osmosis units. A thermoelectric generator is also utilized to convert dissipated heat into electricity. The proposed system is comprehensively analyzed from energy, exergy, economic, and sustainability standpoints. The effect of design parameters such as heliostat concentration ratio, view factor, desalination mass flow ratio, SOEC operating temperature, and current density on the hydrogen, oxygen and freshwater generation rate, sustainability index, total cost rate, and overall performance of the energy system are discussed. Further, multi-objective optimization based on non-dominated sorting genetic algorithm (NSGA-II) is implemented to identify the optimal operating state of the system. Comparative assessment of the system in the actual condition in the Middle East region showed that the plant has higher performance in June compared to December. Also, optimization revealed that by choosing C = 988, P7 = 1500 kPa, P8 = 300 kPa, MFD = 2.5 and Tcell = 1250 K, the highest obtainable exergy efficiency and minimum total cost rate in the optimal operating state would be 11.32 % and 78.18 $/h, respectively.