The present research introduces an innovative zero-energy building complex equipped with a rule-based control approach for higher integration of renewable resources in the local energy network while bringing down energy costs. The idea centers on establishing several smart controllers to achieve a bidirectional interaction with the heating/electricity network for peak demand shaving and mitigate energy costs. The proposed system comprises Alkaline fuel cells integrated with a hydrogen storage tank driven by either a vanadium chloride cycle or an electrolyzer unit. The system also has an absorption chiller and smart thermal energy storage to supply the heating and cooling demands. TRNSYS-MATLAB developed code is applied to assess the system's indicators from techno-economic standpoints for a residential building complex in the Scandinavian climate. Also, the parametric investigation and time-dependent analysis are carried out to examine the impact of decision parameters and the ambient condition. According to the results, the solar system's physical appearance is very important since it significantly affects performance efficiency and total cost. The results further reveal that picking up the cells' current from 300 A to 500 A improves the performance efficiency by around 12% while lowering the total cost, illustrating the importance of optimization. The results highlight the importance of smart controllers by showing that over 70% of the year's net energy values are positive, indicating that the proposed system may meet demand and sell excess electricity+heating productions to regional networks. The results further demonstrate that since the net energy values are positive for the majority of days in the spring and summer, the system might operate more independently from the local energy networks on warmer days. Eventually, the higher share of solar in summer and wind energy in colder days for hydrogen production shows that the renewable resources combination results in a secure energy supply to obtain the highest independence from the local grid throughout the year.