Surah An-Noor

24:3

ٱلزَّانِى لَا يَنكِحُ إِلَّا زَانِيَةً أَوْ مُشْرِكَةًۭ وَٱلزَّانِيَةُ لَا يَنكِحُهَآ إِلَّا زَانٍ أَوْ مُشْرِكٌۭ ۚ وَحُرِّمَ ذَٰلِكَ عَلَى ٱلْمُؤْمِنِينَ

The fornicator does not marry except a [female] fornicator or polytheist, and none marries her except a fornicator or a polytheist, and that has been made unlawful to the believers.

Tafsir 24:3

A fornicating man does not incline to marry except a fornicating woman like himself or an idolater who does not stay away from fornication. A fornicating woman does not incline to marry except a fornicating man like herself or an idolater who does not stay away from it. And marrying a fornicating male and female has been forbidden for believers.