But when Herod was dead, behold, an angel of the Lord appeareth in a dream to Joseph in Egypt, saying, Arise, and take the young child and his mother, and go into the land of Israel: for they are dead which sought the young child’s life. And he arose, and took the young child and his mother, and came into the land of Israel. But when he heard that Archelaus did reign in Judæa in the room of his father Herod, he was afraid to go thither: notwithstanding, being warned of God in a dream, he turned aside into the parts of Galilee: and he came and dwelt in a city called Nazareth: that it might be fulfilled which was spoken by the prophets, He shall be called a Nazarene. – Matthew 2:19-23
After Herod died, his “kingdom” was divided among three of his sons that he had not killed. The area of Judea was ruled by Archelaus whom we meet here in Matthew 2. Herod Antipas ruled in Galilee. Philip ruled the territory east of Jordan.
Archelaus was appointed by Herod before his death and confirmed by Rome. Apparently, he was evil as well. He sent his army against the people who made an uprising during the Passover and killed at least 3,000 (possibly as many as 9,000) Jews in the streets. Joseph had good reason to be wary of the new king.
Herod Antipas had a milder temperament and Nazareth was a nondescript place. God led Joseph back to his hometown where Jesus would grow up in the safety of obscurity.
When Jesus began his ministry in Jerusalem, the people learned that He was from Nazareth. He was called a Nazarene. This means that Nazareth is His home town. This should be distinguished from a Nazarite who took a vow and did not cut his hair. We have no record of Jesus taking this vow. Therefore, the depictions of Jesus with long hair are inaccurate.
In fact, we do not have much Biblical record of the youth of Jesus in Nazareth.
And the child grew, and waxed strong in spirit, filled with wisdom: and the grace of God was upon him. – Luke 2:40
There are a lot of spurious writings about the childhood of Jesus but none of them are the word of God. We may be intrigued by these stories, but rest assured, God has given us everything we need to know about Jesus in the Bible.