As all have said before me, this is an illegal act. And, downright shameful.
What I would offer additionally is that tenants need to seek housing assistance BEFORE their rent is due. And, don't stop seeking assistance while you're calling the police and moving back in because the landlord will be starting eviction proceedings. Pay partial rent NOW if the landlord will accept it and let him know when the remaining will be paid - and let him/her know that you're seeking a more permanent resolution so this doesn't happen again. You cannot over-communicate nor can you put off seeking assistance.
When you don't pay the rent, you're stealing... plain and simple. The landlord has mortgage payments, insurance, taxes, maintenance/repair expenses so he/she is the greater stakeholder.
I'm sorry this happened to you. Please do what you have to do to ensure that you can pay your rent in full and on time going forward.