Abdur-Rahman bin Abi Layla (may Allah have mercy on him) narrates from Sayyiduna Ubayy bin Ka'b (may Allah be pleased with him) that this woman will remain with her husband on the basis of the remaining divorces; that is, a man who divorced his wife so that she became separated from him, then she married another husband, who also divorced her, then the first husband married her again: she will remain with the first husband on the basis of the remaining divorces.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الخلع والطلاق / 15139