When they (Sim Family A) move out they usually get the money from selling the house.
When a new family (Sim Family B) buys the house, the builder family (Sim Family A) doesn't get the sales money from the new family buying the house. The game doesn't calculate that.