In the layout optimization of natural gas gathering pipeline network, a lot of work has been done, but few scholars focus on the capacity optimization of gas gathering station (short for station). The structural relationship parameters of dendritic pipeline network and the flow parameters of pipeline network are complicated, which makes it difficult to establish the model, and at the same time, the existence of nonlinear term causes the difficulty of solving the problem. In the current two stage star-dendritic natural gas gathering pipeline network, pipeline sizes and station capacity are not well taken into account for the optimization of pipeline network layout at the same time. In this paper, a consideration station capacity and pipeline sizes: Two-stage star-dendritic network layout optimization model (SCPSTSDLO-Model) is constructed by integrating the factors of site discrete characteristics, station capacity and pipeline sizes, and considering the hydraulic pressure drop conditions of the network, and a solution framework based on the nonlinear processing is proposed, which can obtain the optimization results of optimal affiliation, station type, station site and pipeline sizes at the same time. Five cases are used to verify the validity and accuracy of the model and algorithm, compare the sensitivity analysis and solution algorithm, compare the hydraulic pressure drop conditions, and analyze the application in different forms of pipeline networks. The results show that the SCPSTSDLO-Model and the solution method established in this paper can obtain the optimal solutions under different topologies according to the application requirements, taking into account the capacity of stations and pipeline sizes.