Yes and No. In most cases as long as you are up to date on your house payments you can keep your home. If you are not current, the bankruptcy filing protects the home from foreclosure and this could give you the time you need to get caught up, if you were only a couple of months behind.
If you are significantly behind on your house payments, then a chapter 13 is the only way to go if you want to save your home. The most important thing is to file the bankruptcy as soon as possible so they don’t foreclose on your home. Both a chapter 7 or 13 bankruptcy filing stops foreclosure. The mortgage company would have to then get permission from the bankruptcy court to start the foreclosure process up again. It’s important to meet with an experienced bankruptcy lawyer to lay out a proper strategy for dealing with your debts in a way that protects the property you wish to keep.