I recently got evicted .

so guys i have a question about rent because im kinda confused about the whole thing and idk if im wrong .

earlier this month i paid half the rent and told the landlord i’ll be paying the rest the day of the “last day” the 10th (according to the lease) plus the late fee . the day of me sending him the MORE than half fee he evicted me later on in the day after accepting the money and saying me paying late was fine.

and before this i was never late with my rent whatsoever. he’s also doing the eviction through text because i don’t want to go to court and end up not being able to rent in the future considering im young .

i’ve asked him to send the half pay back to me so im able to move somewhere else , and plus he evicted me after i sent it . but he won’t give it back. he also evicted my roommate and yet she paid nothing to him this month whatsoever so i don’t think it’s fair.

is this illegal ? am i wrong ? or how should i go about this next time ? any responses will help seriously. thankyou guys .