Physiologically, no one among us humans know anything at time of birth except basic emotions. It is a stretch in credulity to believe that the newborn Jesus knew that he was “god”. After all, we are a composite of accumulated knowledge learned since birth through our senses, e.g., eyes, ears, etc. It is obvious that Jesus did not know that he was “god” at birth.
However, as a full grown man he knew that there are many “gods”, like Satan as god of this world (Jn 12:31;II Cor 4:4), idols, and all humans as in …Jn.10:34 when Jesus classified humans as, “Jesus answered them , Is it not written in your law , I said , Ye (humans) are gods ?”
There is no indication since his birth until Luke 2:49, when as a boy about 12 years old, Jesus acknowledged “his Father’s business”, suggesting that he knew he is the prophesied Son. As we all have learned from our parents, presumably, Mary and Joseph told him about ” immaculate conception” during childhood.
And this identity as prophesied Son became official at baptism not only from John the Baptist but from God the Father himself through the Spirit in Luke 3:22 “And the Holy Ghost descended in a bodily shape like a dove upon him, and a voice came from heaven, which said, Thou art my beloved Son; in thee I am well pleased”
After that baptism, he was then “full in Spirit” since. Also, Jesus was reading Isaiah in Luke 4:18 “The Spirit of the Lord is upon me,”.”; v-21 “And he began to say unto them, This day is this scripture fulfilled in your ears.”
During Satan’s temptation of Jesus, Luke 4:12 he indicated himself as “Lord your God”. This is a reference made from Deut. 6:16 about the Lord God (YHVH ELOHIM), who was the Creator (Gen. 2:4), Logos and Jesus himself (Jn. 1:1-3).
In summary, Jesus as YHVH ELOHIM knew he was God. But, after incarnation into man-Jesus, he did not know this as a newborn. During childhood, he learned that he was the “prophesied Son” from his parents Mary/Joseph, later from John the Baptist and officially from God the Father himself.