This paper presents the generation and transmission expansion planning (GTEP) in electricity and gas networks by considering their resilience against floods and earthquakes. These networks supply electricity, heat, and gas consumption energies as a multi‐carrier microgrid. The scheme is expressed in the form of bi‐level optimization, the upper level of which is the minimization of generation and transmission planning cost (total investment cost and expected operating cost) in the mentioned networks constrained to the investment budget and the planning model of the mentioned elements. Lower‐level formulation minimizes the total expected annual operating cost of these networks and the expected outage cost of electricity, heat, and gas consumers in the event of floods and earthquakes. This formulation is bound by the power flow equations of electricity and gas networks, the operation and resilience constraints of the networks, and the limitation on generation capability. In this problem, the expected energy not‐supplied and the outage cost during natural disasters are considered resilience indicators. Next, a single‐level model for the proposed design is extracted from the Karush–Kuhn–Tucker (KKT) method. The basic requirement of this method is the convexity of the lower‐level constraints. For this purpose, first, a linear approximation model is obtained for the lower‐level constraints of the problem. Furthermore, stochastic optimization is adopted to model the uncertainty of load, renewable power, and network equipment availability during floods and earthquakes. Finally, the extracted numerical results confirm the capability of the proposed scheme in improving the operation and resilience of the mentioned networks using optimal generation and transmission planning.