You can use Chapter 7 bankruptcy to save your house if:
If you're not—and can't get—current on your payments, Chapter 7 bankruptcy will be only a temporary remedy unless you're able to get a loan modification, which isn't guaranteed. (Learn more about what happens if you own a home and file for Chapter 7 bankruptcy.)
You should instead explore Chapter 13 bankruptcy, which provides a way for you to keep your house by spreading out your missed payments over several years. (Read more about whether you should file for Chapter 7 or Chapter 13 if you want to keep your home.)
Suppose you are current on your payments but expect to fall behind in the very near future for one reason or another. This might be the case if your mortgage interest rate is due to reset higher, you've reached the principal cap on an interest-only loan, or you have just lost some work hours or been laid off.
In these and similar situations, Chapter 7 bankruptcy might be a big help. Except for a few categories of debt—like student loans (with rare exceptions), most back taxes, back child support and alimony—you can eliminate virtually all your unsecured debt (and you can even stop paying them before you file). That's right, all your credit card debt, personal loans, medical debts, money judgments, and car repossession deficiencies go away. Once your unsecured debt load is eliminated or greatly reduced, you will have a much better chance of being able to pay your mortgage.
Once you file, though, you might not be able to change your mind. If you file for Chapter 7 and then discover that you won't be able to keep your house because it has too much equity, you probably won't be allowed to back out and dismiss your bankruptcy case. Your right to dismiss is based on the best interests of your creditors, and if the creditors would receive a distribution from the sale of your house, their interests require the bankruptcy to go forward. If the trustee sells your home, you'll receive the amount you're entitled to exempt, and your creditors will get paid out of the remaining proceeds.
In every Chapter 7 case, the bankruptcy trustee is primarily interested in finding property belonging to the debtor that can be sold for the benefit of the creditors. Unless selling the property would produce money for the creditors, the trustee isn't interested in it. The measure of value in property that might benefit creditors is the equity. The primary purpose of exemptions is to protect equity by requiring the trustee to pay you the amount of the exemption if the property is sold. Selling property that's covered by an exemption would benefit you, not your creditors, so the trustee won't sell it—and you'll get to keep it (subject to any outstanding loans against it).
To find out if filing bankruptcy might be right for your situation, talk to a bankruptcy lawyer.