Talk to a local experienced bankruptcy lawyer. If there is equity in the house after deducting the payoff on the first mortgage and any priority liens, you should not have a problem. If there is equity, it gets more complicated, but you may be able to keep the house with a Chapter 13.