If you already own a home you must give up your home if you file for Bankruptcy.
To the contrary both Chapter 7 and Chapter 13 can be used to keep your home.
Your home mortgage is a secured debt.
In a Chapter 7 bankruptcy, if you are current on your home mortgage and want to keep your home, then you will normally agree to reaffirm the mortgage and keep your house.
If you are behind on your house note, known as being in arrears, you can propose a Plan where you would catch up on the arrearages.
There are circumstances where you may want to give up your home or may have to give up your home.
In a Chapter 7 bankruptcy you are permitted to surrender the home to your secured creditor if you are behind on the house note. However when you do so, the secured creditor is limited to what they can get for the home.
Also, if you are not able to propose a Chapter 13 Plan that will allow you to catch up on the arrearages, then you will in all likelihood have to give up the home.
You should speak with an experienced bankruptcy attorney when deciding whether to give up your home to a creditor.
You probably have more options than you think.