With energy communities and local electricity markets on the rise, the possibilities for prosumers to be actively involved in the energy system increase, creating more complex settings for energy communities. This paper addresses the following research question: Does having knowledge about the future development in energy communities help make better decisions selecting new participants than without consideration of any future developments? Each year, the community is faced with the exit of existing members and a portfolio of possible new entrants with different characteristics. For this purpose, a bi-level optimization model for dynamic participation in local energy communities with peer-to-peer electricity trading, which is able to select the most suitable new entrants based on the preferences of the members of the original community, is extended to a stochastic dynamic program. The community wants to plan a few years ahead, which includes the following uncertainties: (i) which members leave after each period, and (ii) which are the potential new members willing to join the community. This paper’s contribution is a stochastic optimization approach to evaluate possible future developments and scenarios. The focus lies on the contractual design between the energy community and new entrants; the model calculates the duration of contracts endogenously. The results show a sample energy community’s decision-making process over a horizon of several years, comparing the stochastic approach with a simple deterministic alternative solution.