Basically, in most cases, you can move to a new place, list the old one in your bk and wipe out those unpaid rents.
That being said, it gets complicated pretty quickly.
Most people qualify for a basic chapter 7 case. In a chapter 7, you can list your debts (including unpaid rents), and all of those debts are wiped out except for certain priority debts like taxes, criminal restitution, child support and alimony, and student loans. Unpaid rents are the kind of debts that are wiped out. (Those are also discharged in a chapter 13, but you may have some kind of payment plan on those over a 5 year period).
Here are a few different scenarios:
Move to new rental then file bankruptcy — Now let’s say you haven’t paid rent for the past year due to the Pandemic, and now you move to a new rental. You can list the old rental in the bk and wipe out that balance, including collection fees and costs. The bankruptcy does not wipe out your new lease, and you can keep paying rents at the new home.
No eviction yet, file bankruptcy, then move — What if you haven’t paid rent in a while, and you need to file bankruptcy right away? You can file bankruptcy and wipe out those unpaid rents. BUT, and this is a big “but,” you are liable for any fees you incur from the day you file until the day you move out. Let’s say that you’re apartment costs $1,000 per month and you are $10,000 behind in rent. You decide to file bankruptcy, and then move out a month later. You can wipe out that $10k of back rent, but you must pay that $1,000 for the month you stay after filing your case.
Eviction ready to be filed and you file bankruptcy — If the eviction proceedings haven’t been filed yet, then they cannot evict you. Well, they can, but there are a bunch of hoops to jump through. If you file bk before they file eviction, then they will need to file a bankruptcy court motion to lift the automatic stay (the bankruptcy protection), and then they can evict you. Don’t forget that you still owe those unpaid rents for the time you occupy the home after filing bankruptcy until you move out.
Eviction filed before you file bankruptcy — The landlord wins. If he gets that signed eviction order before you file your chapter 7, you need to move out immediately. He doesn’t care that you have no place to go. He wants you out, and that eviction order is enforceable.