Short answer
A person who says the shahadah sincerely, believing it, is a Muslim even if marriage is what first brought them to Islam, and their nikah is valid. But saying the words without believing them does not make anyone a Muslim before Allah. Never pressure someone into a pretend conversion. The four schools agree.
Islam is established outwardly by the shahadah, and a nikah is judged by that outward state. Belief in the heart is what counts before Allah, so a conversion only on the tongue, with no belief, does not make the person Muslim in reality, and a Muslim woman's marriage to such a man is not lawful before Allah.
The four schools agree on this.
Explanation
When Abu Talhah proposed to Umm Sulaym, he was not yet Muslim. She told him she had accepted Islam and would marry him if he did. He became Muslim, and the narrator said his Islam was her mahr. He became one of the finest Companions. Marriage can be a door to faith.
What makes someone Muslim is belief in the heart, declared with the shahadah. See how to convert. The motive that first brings a person matters for their reward, since deeds are judged by intentions, but a sincere shahadah is valid even if love opened the door. Many who start this way grow into strong believers.
- A Muslim man and a Christian or Jewish woman. She does not have to convert to marry him. See marrying a Christian or Jewish woman.
- A Muslim woman and a non-Muslim man. He must truly become Muslim before the nikah. See why a Muslim woman cannot marry a non-Muslim.
- A pretend conversion. If he has no belief and only says the words, he is not Muslim before Allah, and a woman who knows this is entering a marriage Allah has not made lawful. Give time: let him learn, meet an imam and practise before the nikah.
- Leaving Islam later. In the Hanafi school a husband's apostasy ends the nikah at once, and a wife's apostasy has its own details in later Hanafi fatwa. Ask a mufti if this happens.
To anyone accepting Islam: you are welcome, whatever first brought you. Start with the new Muslim guide and ghusl after converting.
The evidence
Quran, Surah Al-Baqara 2:256
لَآ إِكْرَاهَ فِى ٱلدِّينِ ۖ قَد تَّبَيَّنَ ٱلرُّشْدُ مِنَ ٱلْغَىِّ ۚ فَمَن يَكْفُرْ بِٱلطَّٰغُوتِ وَيُؤْمِنۢ بِٱللَّهِ فَقَدِ ٱسْتَمْسَكَ بِٱلْعُرْوَةِ ٱلْوُثْقَىٰ لَا ٱنفِصَامَ لَهَا ۗ وَٱللَّهُ سَمِيعٌ عَلِيمٌ ﴿٢٥٦﴾
There shall be no compulsion in [acceptance of] the religion. The right course has become clear from the wrong. So whoever disbelieves in Taghut and believes in Allah has grasped the most trustworthy handhold with no break in it. And Allah is Hearing and Knowing.
Faith must be chosen, not forced, including through pressure to marry.
Quran, Surah Al-Mumtahana 60:10
يَٰٓأَيُّهَا ٱلَّذِينَ ءَامَنُوٓا۟ إِذَا جَآءَكُمُ ٱلْمُؤْمِنَٰتُ مُهَٰجِرَٰتٍۢ فَٱمْتَحِنُوهُنَّ ۖ ٱللَّهُ أَعْلَمُ بِإِيمَٰنِهِنَّ ۖ فَإِنْ عَلِمْتُمُوهُنَّ مُؤْمِنَٰتٍۢ فَلَا تَرْجِعُوهُنَّ إِلَى ٱلْكُفَّارِ ۖ لَا هُنَّ حِلٌّۭ لَّهُمْ وَلَا هُمْ يَحِلُّونَ لَهُنَّ ۖ وَءَاتُوهُم مَّآ أَنفَقُوا۟ ۚ وَلَا جُنَاحَ عَلَيْكُمْ أَن تَنكِحُوهُنَّ إِذَآ ءَاتَيْتُمُوهُنَّ أُجُورَهُنَّ ۚ وَلَا تُمْسِكُوا۟ بِعِصَمِ ٱلْكَوَافِرِ وَسْـَٔلُوا۟ مَآ أَنفَقْتُمْ وَلْيَسْـَٔلُوا۟ مَآ أَنفَقُوا۟ ۚ ذَٰلِكُمْ حُكْمُ ٱللَّهِ ۖ يَحْكُمُ بَيْنَكُمْ ۚ وَٱللَّهُ عَلِيمٌ حَكِيمٌۭ ﴿١٠﴾
O you who have believed, when the believing women come to you as emigrants, examine them. Allah is most knowing as to their faith. And if you know them to be believers, then do not return them to the disbelievers; they are not lawful [wives] for them, nor are they lawful [husbands] for them. But give the disbelievers what they have spent. And there is no blame upon you if you marry them when you have given them their due compensation. And hold not to marriage bonds with disbelieving women, but ask for what you have spent and let them ask for what they have spent. That is the judgement of Allah; He judges between you. And Allah is Knowing and Wise.
A Muslim woman may only marry a Muslim man.
Sunan an-Nasa'i 3340
Grading to be checked... فكان صداق ما بينهما الإسلام ...
"So Islam was the mahr between them."
Abu Talhah became Muslim in order to marry Umm Sulaym, and his Islam was accepted.
Sahih al-Bukhari 1
Sahih... إنما الأعمال بالنيات ...
"Deeds are only by intentions."
The reward of an act follows its intention, so sincerity matters.
Where the ruling is recorded
- al-Hidaya, Kitab al-Nikah, Bab Nikah Ahl al-Shirk. The rules when one spouse accepts Islam, and that apostasy ends the marriage.
- Radd al-Muhtar (Ibn Abidin), Kitab al-Jihad, Bab al-Murtadd. Islam is judged outwardly by the shahadah, while true faith is in the heart.
Checked by our team. For a more accurate answer to your own situation, consult a scholar. Quran translation by Sahih International. Hadith Arabic from the standard editions of the six books and the Muwatta, with gradings as recorded there; the English is our own rendering. Spotted a mistake? Tell us.