maybe
1) it must have been taken out to acquire Ex's interest in a first or second home. I take this to mean Ex must be on the title to the property.
2) the debt must be secured by the home
3) your mortgage/HELOC amount does not exceed the applicable limits
secured debt is one in which you sign an instrument (such as a mortgage, deed of trust, or land contract) that makes your ownership in a qualified home security for payment of the debt, is recorded or otherwise perfected under any applicable state or local law, and provides in case of default, that your home could satisfy the debt