Sayyiduna Anas bin Malik (may Allah be pleased with him) narrates that Umm Habibah (may Allah be pleased with her) said: O Messenger of Allah! If a woman among us has two husbands, then she dies and enters Paradise, she and both her husbands as well, whose wife will she be, the first's or the other's? He (peace and blessings be upon him) said: "She will choose whichever of the two had the better character with her in the world, and he will be her husband in Paradise. O Umm Habibah! Good character takes away the good of this world and the Hereafter."
Hadith Referenceالمعجم الكبير للطبراني / مسند النساء / 19715