Can my roommate kick me out if I'm not on the lease?

I've been living in an apartment for a month now, though, I'm not on the lease.
My roommate is a friend I've known for a year and we had agreed I move into the 2 bedroom apartment so it's more affordable for him to pay rent.
Lately there has been some power struggle issues with him threatening to kick me out, and has succeeded once, and had the locks changed so I couldn't get into the apartment building.
I'm just wondering if any of this is legal? I have a receipt saying the building manager accepted my rent so does that gain me any rights?
Asked Apr 28, 2017

TIP: If it's not your answer to this question, please click "Leave a Comment" button under the question to communicate with the question owner.