  Involving residential actors in the energy transition is crucial for its
success. Local energy generation, consumption and trading are identified as
desirable forms of involvement, especially in energy communities. The
potentials for energy communities in the residential building stock are high
but are largely untapped in multi-family buildings. In many countries, rapidly
evolving legal frameworks aim at overcoming related barriers, e.g. ownership
structures, principal-agent problems and system complexity. But academic
literature is scarce regarding the techno-economic and environmental
implications of such complex frameworks. This paper develops a mixed-integer
linear program (MILP) optimisation model for assessing the implementation of
multi-energy systems in an energy community in multi-family buildings with a
special distinction between investor and user. The model is applied to the
German Tenant Electricity Law. Based on hourly demands from appliances, heating
and electric vehicles, the optimal energy system layout and dispatch are
determined. The results contain a rich set of performance indicators that
demonstrate how the legal framework affects the technologies' interdependencies
and economic viability of multi-energy system energy communities. Certain
economic technology combinations may fail to support national emissions
mitigation goals and lead to lock-ins in Europe's largest residential building
stock. The subsidies do not lead to the utilisation of a battery storage.
Despite this, self-sufficiency ratios of more than 90% are observable for
systems with combined heat and power plants and heat pumps. Public CO2
mitigation costs range between 147.5-272.8 EUR/tCO2. Finally, the results show
the strong influence of the heat demand on the system layout.
