كتاب الأيمان
27  
The Book of Oaths
(5)
Chapter: Saying: "If Allah wills" when swearing oaths and at other times
(5)
باب الاِسْتِثْنَاءِ ‏‏
Sahih Muslim 1654 a

Abu Huraira reported that (Hadrat) Sulaiman had sixty wives. He (one day) said:

I will visit each one of them every night, and every one of them will become pregnant and give birth to a male child who will be a horseman and fight in the cause of Allah. But (it so happened) that none of them became pregnant except one, but she gave birth to an incomplete child. Thereupon Allah's Messenger (ﷺ) said: Had he said Insha' Allah (if God so wills), then every one of them would have given birth to a child who would have been a horseman and fought in the cause of Allah
حَدَّثَنِي أَبُو الرَّبِيعِ الْعَتَكِيُّ، وَأَبُو كَامِلٍ الْجَحْدَرِيُّ فُضَيْلُ بْنُ حُسَيْنٍ - وَاللَّفْظُ لأَبِي الرَّبِيعِ - قَالاَ حَدَّثَنَا حَمَّادٌ، - وَهُوَ ابْنُ زَيْدٍ - حَدَّثَنَا أَيُّوبُ، عَنْ مُحَمَّدٍ، عَنْ أَبِي هُرَيْرَةَ، قَالَ كَانَ لِسُلَيْمَانَ سِتُّونَ امْرَأَةً فَقَالَ لأَطُوفَنَّ عَلَيْهِنَّ اللَّيْلَةَ فَتَحْمِلُ كُلُّ وَاحِدَةٍ مِنْهُنَّ فَتَلِدُ كُلُّ وَاحِدَةٍ مِنْهُنَّ غُلاَمًا فَارِسًا يُقَاتِلُ فِي سَبِيلِ اللَّهِ فَلَمْ تَحْمِلْ مِنْهُنَّ إِلاَّ وَاحِدَةٌ فَوَلَدَتْ نِصْفَ إِنْسَانٍ فَقَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم ‏ "‏ لَوْ كَانَ اسْتَثْنَى لَوَلَدَتْ كُلُّ وَاحِدَةٍ مِنْهُنَّ غُلاَمًا فَارِسًا يُقَاتِلُ فِي سَبِيلِ اللَّهِ ‏"‏ ‏.‏
Reference : Sahih Muslim 1654a
In-book reference : Book 27, Hadith 32
USC-MSA web (English) reference : Book 15, Hadith 4066
  (deprecated numbering scheme)