Sahih Muslim

Sahih Muslim 346 b

At the beginning of Islam, intercourse did not necessitate ghusl unless semen was emitted, then that was abrogated and ghusl becomes obligatory for intercourse
Arabic hadith text
وَحَدَّثَنَا مُحَمَّدُ بْنُ الْمُثَنَّى، حَدَّثَنَا مُحَمَّدُ بْنُ جَعْفَرٍ، حَدَّثَنَا شُعْبَةُ، عَنْ هِشَامِ بْنِ عُرْوَةَ، حَدَّثَنِي أَبِي، عَنِ الْمَلِيِّ، عَنِ الْمَلِيِّ، - يَعْنِي بِقَوْلِهِ الْمَلِيِّ عَنِ الْمَلِيِّ أَبُو أَيُّوبَ، - عَنْ أُبَىِّ بْنِ كَعْبٍ، عَنْ رَسُولِ اللَّهِ صلى الله عليه وسلم أَنَّهُ قَالَ فِي الرَّجُلِ يَأْتِي أَهْلَهُ ثُمَّ لاَ يُنْزِلُ قَالَ ‏"‏يَغْسِلُ ذَكَرَهُ وَيَتَوَضَّأُ ‏"
Translation
Ubayy ibn Ka'b narrated it from the Messenger of Allah (ﷺ) that he said

If a person has sexual intercourse with his wife, but does not experience orgasm, he should wash his organ and perform an ablution.