Thank you for the question, “Is it a sin not to follow God or being an atheist or agnostic?”
The Apostle Paul states God’s perspective of humans who refuses to acknowledge the Creator God or to follow him.
Romans 1 says this, ”The wrath of God is being revealed from heaven against all the godlessness and wickedness of people, who suppress the truth by their wickedness, 19 since what may be known about God is plain to them, because God has made it plain to them. 20 For since the creation of the world God’s invisible qualities—his eternal power and divine nature—have been clearly seen, being understood from what has been made, so that people are without excuse.
21 For although they knew God, they neither glorified him as God nor gave thanks to him, but their thinking became futile and their foolish hearts were darkened. 22 Although they claimed to be wise, they became fools 23 and exchanged the glory of the immortal God for images made to look like a mortal human being and birds and animals and reptiles” (A searchable online Bible in over 150 versions and 50 languages). Citations are from the New International Version.
The atheists do not believe in God or sin against him. Thus the question is irrelevant. One can’t sin against someone who doesn’t exist or at least haven’t demonstrated any “scientific proof” of his existence. The natural explanation is the accepted view that life evolved from lower forms to higher forms by random chance.
The agnostics are uncertain as to the existence of God. That person hasn’t seem any “scientific proof” of his existence but doesn’t discount the possibility of God’s existence. The argument of a natural evolution of the universe or of earth is plausible, but it is not absolute. That person leaves a 5% chance or less of God’s existence unless that person has a divine encounter with God.
The Apostle Paul states that each person will be judged by his/her own conscience. Romans 2 says this, “They show that the requirements of the law are written on their hearts, their consciences also bearing witness, and their thoughts sometimes accusing them and at other times even defending them. 16 This will take place on the day when God judges people’s secrets through Jesus Christ, as my gospel declares” (NIV).
If a person is 100% absolute sure that God doesn’t existence and that there is nothing after death, then there is no accountability after death. If a person has a 1–2% chance that s/he may be wrong, then I would encourage that person to do his/her due diligence in examining the “evidence” or reasons for the existence or non-existence of God. Listen to debates, read both views, and come to one’s own conviction. The quest for the origin of life will lead one to consider the existence or non-existence of God.
SUMMARY: If God existence, then one is accountable to him. If God does not existence, then there is no accountability. Doing one’s due diligence is imperative.
For more perspectives:
https://thechristiancorner.quora.com/Is-it-a-sin-not-to-follow-God-or-being-an-atheist-or-agnostic