Revelation 20:12 states: "And I saw the dead, small and great, stand before God; and the books were opened: and another book was opened, which is the book of life: and the dead were judged out of those things which were written in the books, according to their works.
there is a condition on whose names will be in the book of life
Revelation 3:1-5
To the angel of the church in Sardis write the following:
“This is the solemn pronouncement of the one who holds the seven spirits of God and the seven stars: ‘I know your deeds, that you have a reputation that you are alive, but in reality you are dead. 2 Wake up then, and strengthen what remains that was about to die, because I have
not found your
deeds complete in the sight of my God. 3
Therefore, remember what you received and heard, and obey it, and repent. If you do not wake up, I will come like a thief, and you will never know at what hour I will come against you. 4 But you have a few individuals in Sardis who have not stained their clothes, and they will walk with me dressed in white, because they are worthy. 5
The one who conquers will be dressed like them in white clothing, and
I will never erase his name from the book of life, but will declare his name before my Father and before his angels.