The proportion of distributed power generation (DG) connected to the power grid is continuously increasing, and the connection of DG to the power grid significantly impacts the relay protection system and pollutant emissions. This paper establishes a multi-objective function that considers the reliability factor of relay protection, the total amount of polluting gas emissions, power loss, voltage stability index, and total cost. The weight of each objective in the multi-objective function is determined by applying Analytic Hierarchy Process (AHP). To increase the practicability of the model, the site construction conditions are added as constraints. Moreover, this paper improves the latest heuristic JAYA algorithm, introduces a mutation operator to enhance its searchability, and introduces an acceptance criterion to balance the algorithm's global search and local search ability. Finally, simulation analysis based on the IEEE69 node arithmetic example shows that the model can solve the distributed siting and capacity setting problem with good search capability and speed. The model can ensure the economy and, at the same time, can achieve the goals of comprehensive improvement of relay protection system stability and reduction of total system pollutant gas emissions, while the model has strong practicality.