Matthew 19:
28 Jesus said to them, “Truly I tell you, at the renewal of all things, when the Son of Man sits on his glorious throne, you who have followed me will also sit on twelve thrones, judging the twelve tribes of Israel.
the day for judging for rewards
29And everyone who has left houses or brothers or sisters or father or mother or wife or children or fields for my sake will receive a hundred times as much and will inherit eternal life. 30But many who are first will be last, and many who are last will be first.
Many who are first in coming into the kingdom of God will be rewarded less. Many who come later into the kingdom will be rewarded more.
The word "first" refers to either first (come) in time or first (prize) in reward.
Similarly, the word "last" has these two possible meanings.
These terminologies are repeated in Matthew 20:
8 “When evening came, the owner of the vineyard said to his foreman, ‘Call the workers and pay them their wages, beginning with the last ones hired and going on to the first.’
"last" in terms of time
9 “The workers who were hired about five in the afternoon came and each received a denarius.
but they were rewarded the first prize, a full day's reward
16 “So the last will be first, and the first will be last.”
The latecomers received first prize. The early comers received the same prize after the latecomers.
These "first" and "last" teminolgies are used in Luke 13 as well:
29 People will come from east and west and north and south, and will take their places at the feast in the kingdom of God. 30Indeed there are those who are last who will be first, and first who will be last.”
Some latecomers will be rewarded first and some early comers will be rewarded last.