If a man who has lived a very sinful life, decides to change his ways. Makes a long confession one hour before Jesus' second coming. Would he be put with the sheep or goats??
Please don't answer "you always need to be rrady, don't wait to convert etc I know that - it's not what I'm asking
Without question he would be a sheep, unless during the hour between his confession and the Second coming, he returned to his old life.
All it takes to be one of the sheep is to die with sanctifying grace in the soul. Sanctifying grace is a created participation in the supernatural life of God, which He infuses into the soul. This divine life is what makes us children of God and heirs of heaven. It is first received at baptism; it is lost whenever a person commits a single mortal sin; and it is re-infused into the soul by God in confession. No matter how sinful a life a Catholic has lived, all it takes to get back into the state of grace - to be a child of God and heir of heaven - is a sincere confession. The Good Thief live a horrible life, repented just before he died, and was with Christ in Paradase later that same day - "
this day thou shalt be with me in paradise".
And if you are scrupulous for having lived a bad life,
don't be. "There is more joy in heaven over one sinner doing penance than over 99 just souls who had not need of penance."