This is a common misconception. No one can keep the Law PERFECTLY and all have sinned and come short of the glory of God.
But even the Gentiles who do not have the Law can do righteous deeds. Thus saith the Holy Spirit through Paul:
ROMANS 2: TOTAL DEPRAVITY IS TOTALLY FALSE
10 But glory, honour, and peace, to every man that worketh good, to the Jew first, and also to the Gentile:
11 For there is no respect of persons with God.
12 For as many as have sinned without law shall also perish without law: and as many as have sinned in the law shall be judged by the law;
13 (For not the hearers of the law are just before God, but the doers of the law shall be justified.
14 For when the Gentiles, which have not the law, do by nature the things contained in the law, these, having not the law, are a law unto themselves:
15 Which shew the work of the law written in their hearts, their conscience also bearing witness, and their thoughts the mean while accusing or else excusing one another,
16 In the day when God shall judge the secrets of men by Jesus Christ according to my gospel.