Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
bayhaqi:15202Abū Zakariyyā b. Abū Isḥāq al-Muzakkī from my father

[Machine] In His saying, "If he divorces her, she shall not be lawful for him until she marries another husband." [Al-Baqarah 230], He means that if he divorces her three times, she will not be lawful for him until she marries another husband. Then He said, "If he divorces her, then there is no sin upon them if they return to each other." [Al-Baqarah 230], meaning that if she marries someone else after the first husband, and the second husband then has sexual intercourse with her, there is no harm for the first husband to marry her if the second husband divorces her or dies. And it has been narrated from Al-Qasim ibn Muhammad about the death of the second husband for her, before touching her, that it is not lawful for her first husband to marry her.  

البيهقي:١٥٢٠٢أَخْبَرَنَاهُ أَبُو زَكَرِيَّا بْنُ أَبِي إِسْحَاقَ الْمُزَكِّي أنا أَبُو الْحَسَنِ الطَّرَائِفِيُّ نا عُثْمَانُ بْنُ سَعِيدٍ نا عَبْدُ اللهِ بْنُ صَالِحٍ عَنْ مُعَاوِيَةَ بْنِ صَالِحٍ عَنْ عَلِيِّ بْنِ أَبِي طَلْحَةَ عَنِ ابْنِ عَبَّاسٍ ؓ

فِي قَوْلِهِ تَعَالَى {فَإِنْ طَلَّقَهَا فَلَا تَحِلُّ لَهُ مِنْ بَعْدُ حَتَّى تَنْكِحَ زَوْجًا غَيْرَهُ} [البقرة 230] يَقُولُ إِنْ طَلَّقَهَا ثَلَاثًا فَلَا تَحِلُّ لَهُ حَتَّى تَنْكِحَ زَوْجًا غَيْرَهُ ثُمَّ قَالَ {فَإِنْ طَلَّقَهَا فَلَا جُنَاحَ عَلَيْهِمَا أَنْ يَتَرَاجَعَا} [البقرة 230] يَقُولُ إِذَا تَزَوَّجَتْ بَعْدَ الْأَوَّلِ فَدَخَلَ بِهَا الْآخَرُ فَلَا حَرَجَ عَلَى الْأَوَّلِ أَنْ يَتَزَوَّجَهَا إِذَا طَلَّقَهَا الْآخَرُ أَوْ مَاتَ عَنْهَا وَرُوِّينَا عَنِ الْقَاسِمِ بْنِ مُحَمَّدٍ فِي مَوْتِ الثَّانِي عَنْهَا قَبْلَ أَنْ يَمَسَّهَا لَا يَحِلُّ لِزَوْجِهَا الْأَوَّلِ أَنْ يَتَزَوَّجَهَا