Jesus was talking to the Sadducees about marriage.
There were seven brothers, who, married the same woman after each brother died.
Luke
20:27 Then came to [him] certain of the Sadducees, which deny that there is any resurrection; and they asked him,
20:28 Saying, Master, Moses wrote unto us, If any man's brother die, having a wife, and he die without children, that his brother should take his wife, and raise up seed unto his brother.
20:29 There were therefore seven brethren: and the first took a wife, and died without children.
20:30 And the second took her to wife, and he died childless.
20:31 And the third took her; and in like manner the seven also: and they left no children, and died.
20:32 Last of all the woman died also.
20:33 Therefore in the resurrection whose wife of them is she? for seven had her to wife.
20:34 And Jesus answering said unto them, The children of this world marry, and are given in marriage:
20:35 But they which shall be accounted worthy to obtain that world, and the resurrection from the dead, neither marry, nor are given in marriage:
20:36 Neither can they die any more: for they are equal unto the angels; and are the children of God, being the children of the resurrection.
20:37 Now that the dead are raised, even Moses shewed at the bush, when he calleth the Lord the God of Abraham, and the God of Isaac, and the God of Jacob.
20:38 For he is not a God of the dead, but of the living: for all live unto him.