"If thou wilt be perfect" "telios" which means "complete or spiritually mature", go and sell all that thou hast, and give to the poor, and though shalt have treasure in heaven: and come and follow me.
So Jesus' reply was not "if you will be saved" but "if thou wilt be perfect". Therefore, what the rich young ruler walked away from was not salvation but spiritual maturity.