If you're able to reach agreement with your former spouse about a property settlement, the terms can be whatever you agree to, but if not and you need the court to decide, it follows a four-step process:
1. What is the total value of the joint asset pool?
2. What are the financial and non-financial contributions of each party?
3. What are the future needs of each party?
4. Is the settlement just and equitable?
It's unlikely the court would rule that you keep the house and not provide some level of compensation to the other party. The other party would likely be considered to have contributed in other ways, such as non-financially through house-keeping and the like, or financially by using his income to feed and clothe the family while your income was used to pay the mortgage.
Hope this helps.