Clean energy production is now the main challenge for sustainable future which can be addressed by introducing renewable energy sources. Fuel cells are critical in providing sustainable energy solutions by enabling efficient energy conversion in microgrids. To enhance the performance of fuel cell-based microgrids, advanced controllers and inverters are necessary to manage power quality and stability. One of the key benefits of this fuel cell is the separation of energy conversion and management, which allows independent optimization for each function of microgrid's performance, cost, or other installation considerations. The ability to individually control of each component of a microgrid can significantly impact various applications positively. Beyond their technological and economic advantages, fuel cells are highly sensitivity to microgrid's characteristics such as current quality and harmonics which creates difficulties for their design and management. Therefore, the entire microgrid must be managed by an effective energy management strategy and integration of advanced inverter topologies. This study aims to improve fuel cell efficiency and power quality within the microgrid through an advanced energy management (AEM) strategy. The proposed AEM structure is developed focusing on two key components: a self-regulated controller (SRC) and a switched capacitor multilevel inverter (SCMLI). These elements work together to mitigate the disturbances and enhance the power quality of the system. The methodology includes simulation and hardware-in-the-loop (HIL) testing under non-linear load conditions. Initial grid-side current total harmonic distortion (THD) of 28.38% was reduced to 2.19% through the proposed system. An impact analysis is also presented to demonstrates that reducing current harmonics and voltage imbalance have improved the efficiency of fuel cell to 50.18% and fuel utilization to 98.05%. The findings show that the proposed scheme significantly reduces current harmonics and improves the overall performance benchmark of the microgrid and fuel cell.