Due to the energy crisis and exhaustion in the amount of fossil fuels left, there is an urge to increase the penetration of renewables in the grid. This paper deals with the design and control of a hybrid microgrid (HMG) in the presence of variable renewable energy sources. The DC sub-grid consists of a permanent magnet synchronous generator (PMSG) wind turbine, solar PV array with a perturb-and-observe (P&O) MPPT algorithm, boost converter, and battery energy storage system (BESS) with DC loads. The AC sub-grid consists of a PMSG wind turbine and a fuel cell with an inverter circuit synchronized to the grid to meet its load demand. A bidirectional interlinking converter (IC) connects the AC sub-grid and DC sub-grid, which facilitates power exchange between them. The decentralized control of converters allows all the renewables to operate in coordination independently without communication between them. The proposed control algorithm of the IC enables it to act as an active power filter in addition to the power exchange operation. The active power filtering feature of the IC helps to retain the power quality of the microgrid as per IEEE 519 standards by providing reactive power support and reducing the harmonic levels to less than 5%. The HMG with the proposed algorithm can operate in both grid-connected and islanded modes. While operating in grid-connected mode, power exchange between DC and AC sub-grids takes place and all the load demands are met. If it is in islanded mode, a diesel generator supports the AC sub-grid to meet the critical load demands and the BESS supports the DC microgrid. The proposed model is designed and simulated using MATLAB-SIMULINK and its results are analyzed. The efficacy of the proposed control is highlighted by comparing it with the existing controls and testing the HMG for load variations.