If a man is married and his wife dies.. Then he remarries.Which one does he spend eternity with?
Both if they all go to Heaven. Fortunately Heaven isn't like Earth. Relationships won't be the same there as here.
Mark 12:18-25
Then come unto him the Sadducees, which say there is no resurrection; and they asked him, saying,
19 Master, Moses wrote unto us, If a man's brother die, and leave his wife behind him, and leave no children, that his brother should take his wife, and raise up seed unto his brother.
20 Now there were seven brethren: and the first took a wife, and dying left no seed.
21 And the second took her, and died, neither left he any seed: and the third likewise.
22 And the seven had her, and left no seed: last of all the woman died also.
23 In the resurrection therefore, when they shall rise, whose wife shall she be of them? for the seven had her to wife.
24 And Jesus answering said unto them, Do ye not therefore err, because ye know not the scriptures, neither the power of God?
25 For when they shall rise from the dead, they neither marry, nor are given in marriage; but are as the angels which are in heaven.
KJV
There is the answer for that