This paper tackled the issue of identifying the most suitable capacity setup for multi-energy complementary microgrids in rural regions. The microgrid model integrated solar and biogas storage within an AC/DC hybrid system. The use of biogas and solar power generation could meet the electricity load demand of users, as well as the waste heat generated by biogas power generation be used to meet the heat load demand. By integrating the two energy storage methods of electricity and heat storage, the synergistic utilization of electricity and heat energy was achieved to improve the flexibility and energy efficiency of the microgrid system. Through multi-objective optimization, the study aimed to maximize renewable energy utilization, minimize costs and reduce carbon emissions while ensuring power supply reliability. The results suggested that the optimal configuration for this rural microgrid includes a 2.6 kW biogas generator, 30.0 kW photovoltaic panels, a 2.6 kW battery pack and a 10.00 kW bidirectional inverter. This configuration minimized the total net cost and yielded favorable outcomes in terms of various evaluation indicators.