In this paper, a resilience-oriented dynamic planning framework is developed for optimal sizing of the community-integrated energy system components, including photovoltaic system, wind turbine, boiler, power to gas technology, combined heat and power, and storage devices. The proposed framework is formulated as a tri-level linear programming that performs Community-Integrated Energy Systems design under normal conditions at the first level while evaluating system operation during disastrous conditions at the second level. In the third level, re-planning is done based on information-gap decision theory to enhance community-integrated energy systems’ resilience against various natural disasters. Stochastic programming is also employed at all levels to address the uncertainty of electricity market price, energy demand, solar radiation, and wind speed. A detailed P2G system including, a methanation device, electrolysis, and hydrogen storage is designed to improve the resilience of the system. In addition, the power to gas proposed in this model is coupled with a carbon capture unit to mitigate carbon emission by reusing emitted carbon from the flue gas of the boiler and combined heat and power. Various economic metrics and technical constraints are also considered to achieve a realistic design. Numerical simulation results demonstrate that the positive interplay of renewable energy resources and energy storage technologies, specifically P2G, assisted the CIES in maintaining a stable and uninterrupted energy supply during extreme events. The results exhibit that increasing only 10 % of the resilience budget can decrease >93 % of unserved demand and helps reduction of >37 % of carbon emissions.