Justification is not by the law, but freely given by God through His Son
“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.” Rom 3:19.
What does the law declare? It declares the whole world
guilty before God, and here's the conclusion, “therefore by the deeds
of the law there shall no flesh be justified in his sight, for by the law is
the knowledge of sin.”
The law cannot justify you because the law exposes who you
are. The law brings to light your condemnation and your guilt, and so, if God
is to judge you according to your works by the law, He cannot justify you, He
cannot declare you innocent, because the law declares you guilty.