This paper proposes a novel methodology for the optimal design of microgrids in distribution systems with multiple distributed generation units. Following the IEEE Standard 1547.4-2011, the operation and control of large distribution networks can be enhanced by dividing these networks into multiple virtual microgrids. The proposed planning framework incorporates the necessary conditions for microgrids to operate efficiently in gridconnected operating mode and successfully during islanding. To obtain a robust design, the clustering process considers three objectives: maximizing the self-adequacy of the designed microgrids, maximizing microgrid islanding success probability, and a combination of both targets. For this purpose, the PG&E distribution system with 69 buses is selected as a test case. Backtracking search optimization algorithm, a probabilistic load flow approach, and graph-based theories are used to accomplish this research. Simulation results demonstrate the effectiveness of combining the self-adequacy and the islanding success probability objectives in the clustering process. Compared with other strategies present in the previous literature, the proposed framework results in more self-sufficient and successful islands assessed in terms of active and reactive power adequacy as well as voltage constraints. Next, the effects of increased penetration level of distributed generation units and installation of both distributed energy storage units and distributed reactive sources on the design process are examined. Finally, comparison with other microgrid design objectives applied in previous researches reveals that the resultant design is sensitive to the system's reliability, security, and economic requirements.