When you file bankruptcy you need to determine what is the fair market value ("FMV") of your home. You then determine how much remains due on any mortgages or liens on your residence. You subtract the liens from the FMV which leaves you with the net value which is either equity or negative equity. If it is equity, a positive value, you then need to determine if there is an exemption that protects that equity.
There are two types of exemptions you can claim in Massachusetts to protect your MA residence, the state exemption (homestead exemption) which protects up to $500,000 for a MA residence, or the bankruptcy exemption which protects up to $25,150.00 per debtor.