God is just and holy and loving, to answer your question, the law is written on our hearts and it is called our conscience.
Romans 2:12-16
For as many as sinned without Law will also perish without Law. And as many as sinned within Law will be judged through Law.
For not the hearers of the Law are just with God, but the doers of the Law shall be justified.
For when nations not having Law do by nature the things of the Law, they not having Law are a law to themselves,
who show the work of the Law written in their hearts, their conscience witnessing with them, and the thoughts between one another accusing or even excusing,
in a day when God judges the hidden things of men, according to my gospel, through Jesus Christ.
If you do not accept Christ you will be judged according to the law, this much is very clear, but God also has a plan for those who do not ever hear the name Jesus and that is they will be judged against the law written on their hearts.
Folks, it is like Zaac keeps repeating, it is not that hard if God wants us to be His children He will spell it out and make it very easy to understand.
Mark 10:15 Truly I say to you, Whoever does not receive the kingdom of God as a child may not enter into it, never.
Think of yourself as a child of God rather than some highly intellectual scholar, the wisdom of God is foolishness to man and His thoughts are higher than ours.