If you want to look at the Greek grammar, you should look at all the Greek grammar:
Joh 1:1 In the beginning was the Word, and the Word was with God, and the Word was God. (ESV)
Looking at the first clause, "In the beginning" is clearly a reference to
Gen 1:1. The word "was" is the Greek,
en, which is a form of
eimi (I Am), and speaks of continuous action in the past, that is, absolute preexistence before any creation. What that statement means is that when the beginning began, the Word was
already in existence, and hence, there was never a time when he did not exist. The very same applies to the Father, who has absolute preexistence.
In the second clause, "and the Word was with God," it is the Greek
pros that is translated as "with." But it isn't merely speaking of being together or near. It expresses “direction towards,” as in relationship and communion, implying intimacy (see John 17:24). It is important to note here that in the Greek the article is present, so it reads, "the Word was with [the] God." So, God is a reference to someone other than the Word, at a minimum it is a reference to the Father. On that we agree.
When it comes to the last clause, "the Word was God," it is significant that "God" doesn't have the article in the Greek, as it was in the preceding clause. If the article had been present then "Word" and "God" become interchangeable, and they are one and the same, which is the error of Oneness theology. But this whole passage is about the
logos, who the
logos is, not who God is, so John purposely doesn't use the article to avoid equating the two words. What it can only mean then, is that the Word was divine in nature, or deity. However, since there is only one God, it is rightly translated as "the Word was God."
There is only one understanding of this verse--the Word existed for eternity past in intimate relationship with another, who is God the Father (at a minimum), and the Word is divine in nature, making him also God, since God is the only deity.
Looking at verses 2 and 3:
Joh 1:2 He was in the beginning with God. (ESV)
We see a repeat of verse 1 with the use of
en,
pros, and God with the article, reaffirming the timeless preexistence of the Word who was in active communion with the Father.
Joh 1:3 All things were made through him, and without him was not any thing made that was made. (ESV)
Simple, straightforward logic tells us that since "all things were made through" the Word, and that "without him was not any thing made that was made," it necessarily follows that the Word is not something that was made (see also 1 Cor 8:6 and Col 1:16-17). That is, there never was a time when the Word did not exist.
And then verse 14:
John then makes it clear in verse 14 that "the Word became flesh and dwelt among us." That is, the Word,
not the Father, entered into time--Greek for "become" is
egeneto (same as "made" in verse 3)--and took on human flesh. This is all precisely what Paul is speaking of in Phil 2:5-8.
Exactly, except he is the begotten God, not god.
We already know from John 1:1-18 that Jesus is the preincarnate Word, the Son of God, in human flesh. We see throughout the gospel that Jesus believes he preexisted and then came to earth, that he came from the Father, in whose glory he shared before creation (all of which John also discusses in his prologue), and was going to return to the Father. He is simply returning to the place and position in glory from which he came. So, what Jesus says in John 20:17
cannot preclude him from being God.
Jesus says, “to
my Father and
your Father, to
my God and
your God.” He doesn’t use “our.” He is saying that his Father is now their Father but that there is a difference in relationship, in his sonship and theirs. His God is also their God, or, their God is his God, in that as a man, he still prayed to the Father as the one true God. But that in no way precludes Jesus from also being truly God. It is rather one of the main points of John’s gospel. Jesus is simply here stressing the new closeness of relationship between the disciples and God.
When we look at Thomas’s declaration in verse 28, we have other context to consider. He was speaking directly to Jesus and said, “The Lord of me and the God of me.” Notably, that was immediately after the resurrected Jesus repeated Thomas’s own words back to him, despite Jesus not having been present when Thomas spoke them. Not to mention that Thomas use the definite article
ho for
Theos, which, as you pointed out for John 1:1b, is to refer to the one true God. Thomas is literally calling Jesus God. That means the Son is equal to the Father but not the Father.
From beginning to end, John’s gospel teaches that Jesus is truly God and truly man, yet there is only one God. How that can be is explained in John 1:1. Why John can say that is precisely because of his time spent with Jesus and hearing all that Jesus said and seeing all that Jesus did. That is why Thomas called Jesus his Lord and his God and why John wrote what he did in his prologue.