The rule is called context!
2Cor 4:4 The god of this age has blinded the minds of unbelievers, so that they cannot see the light of the gospel that displays the glory of Christ, who is the image of God.
Here, Satan is revealed as “the god of this world”, meaning secular society’s object of worship, instead of God the Father, whose image, character, and power was displayed in Christ’s life and work on earth. They are both called Theos of their particular realms of authority and those within those realms: the god of this age, and the God of the gospel. The comparative nature of the language demands that one is actually God while the other is not, except in the minds of those who worship him as God. It is a contrastive picture.
John 1:1 In the beginning was the Word, and the Word was with God, and the Word was God
The picture here is not contrasting, but coalescing to show the commonality between the Word and God, not their differences.
This is evident in the reaction of the Jewish leaders is John 5, where John writes:
16So, because Jesus was doing these things on the Sabbath, the Jewish leaders began to persecute him.
17In his defense Jesus said to them, “My Father is always at his work to this very day, and I too am working.”
18For this reason they tried all the more to kill him; not only was he breaking the Sabbath, but he was even calling God his own Father,
making himself equal with God.
Doug