Either it's true or he was deceiving the man. He is telling him to give up everything he had and come follow him. How many people do you know who did that? I know none.
Matt. 19:28 Jesus said to them, I tell you the truth, 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. No mention of works there as contributing to their being in Heaven.
He was obviously speaking only to and of the 12 disciples. Their "works" seem to be in that they followed him, physically.
Well, we know Jesus did not ever deceive, so, he was telling him the truth, in fact, he told many people that their righteousness had to exceed even the holiest people they knew (the Pharisees). The man he was speaking to was so full of pride that he thought he deserved eternal life, he would not even look at how sinful he really was. His money was his weak spot it seems. Jesus was showing him and all the others that the perfection of God was impossible for anyone to achieve and, by that, he was pointing them to the only hope they had, Jesus Christ the Savior, the Messiah.