No, this is not a legal arrangement. Employers can allocate a certain portion of your compensation by providing room and board but California wage orders limit this amount. You need to see an employment law attorney to find out what your rights and obligations are.
They say you get what you pay for, and this response is free, so take it for what it is worth. This is my opinion based on very limited information. My opinion should not be taken as legal advice. For true advice, we would require a confidential consultation where I would ask you questions and get your complete story. This is a public forum, so remember, nothing here is confidential. Nor am I your attorney. I do not know who you are and you have not hired me to provide any legal service. To do so would require us to meet and sign written retainer agreement. My responses are intended for general information only.
It is important that you consult with an attorney regarding your specific arrangment. You do not note if there is a written agreement between you and your employer, but Industrial Welfare Commission Order No. 5-2001 Section 10 provides that meals or lodging may not be credited against the minimum wage without a voluntary written agreement. In addition, the maximum amount of wages that rent may be credited against is 2/3 of the ordinary rental value and in no event, more than $451.89 per month (for one employee).