It depends on which chapter of bankruptcy you file under and what your intentions are.
If you file a chapter 7 and you want to keep the home, you will continue making payments as you normally would. However, you should be certain that your equity does not exceed the applicable exemption amount otherwise you may lose the home to liquidation. Exemptions vary by state. An attorney can assist you with applying the appropriate exemptions in your case.
Unless you file a reaffirmation agreement, the mortgage note will be discharged. This means that you are not personally liable for the mortgage note. However, the mortgage (deed of trust) which gives the lender a lien on the home will not be impacted by the bankruptcy. So long as you stay current on the mortgage, the lender will not take possession of the home even if you do not sign a reaffirmation agreement. If you sign a reaffirmation agreement, this will help you qualify for a refinance or loan modification in the future. The main advantage to signing a reaffirmation agreement is that it will help you rebuild credit. By signing a reaffirmation, you will once again be personally liable so be sure you have adequate income and equity before signing one.
If you file a chapter 7 and you have a HELOC or second mortgage, the information above still applies. Regarding second mortgages, you can discharge the debt in chapter 7 or chapter 13. However, you cannot remove a consensual lien in a chapter 7. When you take out a HELOC, the lender can pursue you on the note or foreclose on the deed of trust. When you file bankruptcy, the note will be discharged. The deed of trust will remain.
If you file a chapter 13 and wish to keep your home, you will simply continue making regular monthly payments. If you are behind on the mortgage, you can bring those payments current through the chapter 13 plan while resuming monthly payments outside the plan. You may also surrender a home in a chapter 13. You should only consider doing this if you are upside down on the mortgage.
It may be possible to void a second mortgage in a chapter 13. However, not everyone will qualify. This area of the law is complex. An attorney can explain. In today’s real estate market, it is rare that someone will qualify to remove their second mortgage.