This would be a co-operative society, or a 'co-op':
A Co-operative Society is a membership
organisation run for the mutual benefit of its members – serving their
interests primarily by trading with them or otherwise providing them
with goods, services and facilities – with any surplus usually being
ploughed back into the organisation, although profits can be
distributed to members. A Co-operative Society may or may not be a
social enterprise, depending on its activities and how it distributes
From A GUIDE TO LEGAL FORMS FOR BUSINESS, UK Department for Business, Innovation and Skills
What you describe would be known as a Housing Co-operative which are common in many countries.
The NCDA are the US associated for Co-operatives.