Hi
1) Yes. you can agree upon divorce with the terms that any one wish to leave the property due to another marriage or professional relocation should first offer to sell the property to the other on terms such as payment of actual amount of investment with bank interest . Such contracts are generally called "First Rights of Refusal" and is valid in eyes of law.
2) The agreement between you and your husband on house property with the first right of refusal etc can be incorporated as a separate agreement in itself (as both of you are joint owners)
3)Please note that joint ownership of the house is generally construed as Joint tenants wherein the succession to the property is on the basis of "either or survivor".
4) So you need to ensure that your agreement on ownership of house subsequent to your mutual consent divorce divorce clearly spells out
a) the share of each owner,
b) their individual rights, title, ownership, interests,
c) the rights of each owner to sell/gift/will the respective share of the property to the persons of their choice
5) We based on our experience in similar instances suggest that such agreement should NOT be part of divorce proceedings given that Judges will construe such agreements as possibility of mutual reconciliation and instead prolong the divorce proceedings
( In couple of cases of my client(s) at different courts, the judge(s) had stated that if the parties can agree and resolve related financial/property issues, it is envisaged that they can reconcile and resolve conjugal issues as well) on their own and hence dismissed/delayed the divorce petition.
6) Also you should be able to demonstrate to the court that both of you are separated
a) physical separation of 1 year as mandated by law and if physical separation cannot be established because of various factors,
Alternatively
b) Both of you need to demonstrate to the court that both of you are constructively separated (living in different rooms, withdrawn from the society of each other's family member's and society etc)
7) You can continue as 2 separate individuals in the jointly owned house, post the award of divorce decree.
Hope this information is useful.