Shaykh al-Islam Ibn Taymiyah (may Allaah have mercy on him) was asked this question and he replied in Al-Fataawa al-Kubra:
“Question: a man married a woman and she stipulated that he should not take another wife or make her move from her house, and that she could stay with her mother, so he married her on this basis. Does he have to adhere to this, and if he goes against these conditions, does his wife have the right to annul the marriage or not?
Answer: yes, these conditions and similar ones are valid according to the madhhab of Imaam Ahmad and other scholars among the Sahaabah and Taabi’een, such as ‘Umar ibn al-Khattaab, ‘Amr ibn al-‘Aas, Shurayh al-Qaadi, al-Oozaa’i and Ishaaq. According to the madhhab of Maalik, the condition states that if he marries another wife, (the first wife) has the choice of what to do, and this is a valid condition. The woman has the right to leave him in this case. This is similar to the idea in the Madhhab of Imaam Ahmad. The basis for this is the hadeeth narrated by (al-Bukhaari and Muslim) in al-Saheehayn from the Prophet (peace and blessings of Allaah be upon him): ‘The most deserving of conditions to be fulfilled are those by means of which sexual intercourse becomes permissible for you.’ ‘Umar ibn al-Khattaabsaid: ‘Rights are in accordance with conditions.’ The Prophet dictated that the conditions which make sexual intercourse permissible are more deserving of fulfilment than others. This is the ruling on conditions of this nature.” [al-Fataawa al-Kubra, part 3, Kitaab al-Nikaah].