Not necessarily.
If there is no equity in the house, the trustee in a Chapter 7 will abandon the house to you meaning that you will be able to keep it, as long as you pay the mortgages. A bankruptcy does not relieve the property of the liability for voluntary liens, like mortgages or deeds of trust, nor for tax liens. So, the lender retains the right to foreclose if you don’t pay.
If there is equity in the house, it must be determined whether the equity is exempt. If the equity is exempt, you will be able to keep it, as long as you pay the mortgages. If the equity exceeds the exemptions allowed by the state, you should consider a chapter 13.