Not necessarily but it is possible. If you are a home owner, the level of equity (difference between the value of your property and any loans secured on it) is calculated once you are made bankrupt.
The Trustee would then need to realise the equity for the benefit of your creditors, if the equity is high in value then a sale may be the only option.