Currently, distribution systems are continuously evolving towards modern and flexible structures while integrating promising renewable energy resources (RERs). In this regard, an optimal network constraint-based expansion planning model combined with an optimal integration framework of intermittent RERs is proposed in this work to improve the topological flexibility in modern distribution networks (DNs). Specifically, the best investment locations and times of substations, lines, and RER-based distributed generations (DGs) are jointly taken into consideration. Additionally, the uncertainty-based multiple scenarios are modeled by probability distribution functions to strengthen the robustness and reliability of DNs influenced by the stochastic of renewable energy and load behavior. The novel network constraint is combined with three levels, where the first level introduces the graph theory to guarantee the radiality topology of modern DNs. In the second level of the network constraint, graph theory and fictitious load theory are collaboratively applied to ensure that each subsystem has a reserve connection interconnected to other subsystems. The third level is modifying the conventional fictitious load theory to ensure each subsystem is linked with at least one DG. The proposed planning model is driven by the minimum present value of total cost, including investment cost of branches, DGs, and substations, cost of substations operation, the electricity purchasing cost of substations and DGs, power losses cost, and environmental penalty cost of conventional generators. Numerical results are presented to verify that a more flexible and resilient topology of the DN system is obtained, and criteria evaluation is introduced to validate its higher performance with respect to existing procedures from power supplied quality, environmental burden, and supplied flexibility three aspects.