This is the OVERVIEW of how it works.
You have everybody. There will be the "Bride Class" of 144,000 Jews making up 10% of 1,440,000 others who will have eventual heavenly life. These need to be judges during the millennium so those who have died who are part of this number, including Daniel and many others, come back to life as part of the "first resurrection".
Many others though, who already have their "names written in the book of life" along with the wicked some of whom are already condemned to Gehenna, come back after the millennium during Judgment Day, when they are judged based entirely upon what they did in their earlier lives! There's no second chance here to erase the past. Judgment Day, just basically draws the line of those not already condemned to Gehenna as those in Jesus' day who knowingly rejected him and chose death like the fallen angels with Satan, and those already considered righteous who already have their names written in the "book of life" based upon what they had already done.
So some come back already judged for life or death. The coming back to life is for reconciliation and knowledge. The wicked, for instance, lived out their life, maybe gaining riches by being dishonest and oppressive. They died thinking they got away with it. Or they may be some atheist feeling justified they were able to sin all they wanted because they saw no evidence of any god they wanted to recognize. These will come back, see the paradise and the life given to those who chose to be "good" rather than give into tyranny and they will know before they are finally put to death forever, exactly what the scrore is and what they missed as a penalty for their earlier choices. In this sense, they don't really "rest in peace" but are considered in "torment" because of what they lost. Whatever gains they felt they enjoyed during the minisculely short life they had can't compare to eternal life that fulfills their every hapiness!! In addition, the innocents ones they defrauded will have their sense of JUSTICE done when they see the wicked pay for their crimes. Thus they didn't really get away with anything in the large scheme of things, they did not escape.
But of note, since the wicked are being resurrected only to die again in the lake of fire, it is called the second death.
Thus Judgment Day who bring back the wicked as the Bible says as well as the righteous, affords for "justice" and "truth" and "closure" things we all relate to. It's meaningful when the atheist who died thinking he was right now dies knowing he was wrong. The second death after the resurrection thus robs those going to the second death of thinking they got away with anything. They all die as stupid people, with no dignity in the least, and total LOSERS!
That's what "weeping and gnashing of the teeth" is all about. Weeping, of course, because they will die. But gnashing the teeth in regret because they could have had it all instead. Eternal life, happiness, wealth...whatever. That's why the second death and the lake of fire is described as not being a place of "rest". There is no "rest" there, philosopically speaking, because you don't rest when you die knowing yo're a loser when you had in your hands to be the big jackpot winner, but threw it away...out of stupidity!
REVIEW:
So yes, the Bible says they ALL come back, the righteous and the wicked and the wicked return to death making it a second death. So if somebody tells you some people are not comnig back, then they are contradicting the Bible and they are lying. So don't listen to them. Listen to scripture.
The second resurrection is of both the good and the bad! The bad come back to stand "trial" for their sins, get condemned and see what they gave up and to provide "closure" for those they abused. Then they die the second death.
JC