The Apostle Paul said in 1st Timothy 1:15 "This is a faithful saying, and worthy of all acceptation, that Christ Jesus came into the world to save sinners; of whom I am chief." This is the crux of the gospel message, "...that Christ Jesus came into the world to save sinners..." The Bible says in Romans 3:10 "As it is written, There is none righteous, no, not one..." Paul goes on in the next eight verses to describe the state on mankind. We all fit in there somewhere, some worse than others. Then in Romans 3:19 the apostle concludes his description with, "Now we know that what things soever the law saith, it saith to them who are under the law: that every mouth may be stopped, and all the world may become guilty before God." Everyone, whether Jew or Gentile is guilty of sin before God. It makes no difference if a person's deeds are good or bad. None of us can live good enough to be saved!
It is interesting that the Lord Jesus said in Matthew 5:20, "For I say unto you, That except your righteousness shall exceed the righteousness of the scribes and Pharisees, ye shall in no case enter into the kingdom of heaven." Then in Paul's testimony found in Philippians 3:4-6 he said, "Though I might also have confidence in the flesh. If any other man thinketh that he hath whereof he might trust in the flesh, I more: Circumcised the eighth day, of the stock of Israel, of the tribe of Benjamin, an Hebrew of the Hebrews; as touching the law, a Pharisee; Concerning zeal, persecuting the church; touching the righteousness which is in the law, blameless." This is how I understand his statement, he lived righteously according to the Law of Moses, you couldn't put a finger on his life. He was blameless. But he recognized that his righteousness was totally insufficient to save himself.
So Paul concluded in Philippians 3:7-11, "But what things were gain to me, those I counted loss for Christ. Yea doubtless, and I count all things but loss for the excellency of the knowledge of Christ Jesus my Lord: for whom I have suffered the loss of all things, and do count them but dung, that I may win Christ, And be found in him, not having mine own righteousness, which is of the law, but that which is through the faith of Christ, the righteousness which is of God by faith: That I may know him, and the power of his resurrection, and the fellowship of his sufferings, being made conformable unto his death; If by any means I might attain unto the resurrection of the dead." He recognized what the Lord Jesus meant in Matthew 5:20, that having the righteousness even of a Pharisee was not enough to enter the kingdom of heaven. He needed a righteousness that exceeded his own. He needed the righteousness "...which is through the faith of Christ, the righteousness which is of God by faith..."