“Indeed, I count everything as loss because of the surpassing worth of knowing Christ Jesus my Lord. For his sake I have suffered the loss of all things and count them as rubbish, in order that I may gain Christ and be found in him, not having a righteousness of my own that comes from the law, but that which comes through faith in Christ, the righteousness from God that depends on faith” (Philippians 3:8–9 ESV)
Paul jettisoned all of his hard fought obedience and accomplishments and viewed them as worthless. He found that he was righteous before God not because of what he had accomplished or how well he obeyed, but by faith in Jesus’ perfectly lived life on his behalf. God “imputes” (gives) Christ’s perfectly obedient life to the person who depends upon God for salvation. When God views the believer, He sees the sinless perfection (righteousness) that Jesus earned for us.