If you take out a loan to purchase the apartment, then have your friends pay just enough rent to pay off the loan without profiti yourself (perhaps a small amount extra to cover any recorded time spent in administration responsibilities), that would not be immoral at all.