Renewable Energy Communities (REC) have the potential to become a key agent for the energy transition. Since consumers have different consumption patterns depending on their habits, their grouping allows for a better use of the resource. REC provide both economic and environmental benefits. However, its potential drastically diminishes when grouping of prosumers and energy al- location is performed improperly, as the energy generated ends up not being consumed. Given the importance of extracting the maximum potential of REC, this study presents a tool to assist in both the planning and the operation phases. We present a combinatorial optimization method for participant selection and a multi-objective (MO) optimization of solar energy allocation. Specific Ge- netic Algorithms (GA) were developed including problem-specific approaches for reducing the search space, encoding, techniques for space ordering, fitness functions, special operators to replace duplicate individuals and decoding for equality constraints. The performance of the novel solution approach was exper- imentally proved with an electrical solar installation and electricity consumers from Northern east Spain. The results show that the developed tool achieves energy sharing in REC with low solar energy excess, high self-consumption and high avoided CO2 emissions while assuring low payback periods for all partic- ipants. This tool will be essential to increase revenues of REC schemes and boost their beneficial environmental impact.