Q. If Joseph and Mary fled to Egypt after the birth of Jesus, how old was he when he was presented at the temple in Jerusalem? Did they stop in Jerusalem first, or did they return after a short time in Egypt?
Joseph and Mary did not actually flee to Egypt until two years after Jesus was born. The Magi told Herod that they had first seen the star that led them to come worship the king of the Jews two years earlier. It was Herod’s attempt to destroy this new king by killing all of the boys in Bethlehem who were two years old or younger that led Joseph and Mary to flee to save Jesus’ life.
Luke tells us that Joseph and Mary presented Jesus in the temple “when the time came for the purification rites required by the Law of Moses,” which would have been about forty days after he was born. It seems likely that they would have remained in the area of Bethlehem until then, since they were already so near Jerusalem, where the temple was. But after that, they went somewhere else. Matthew tells us that the Magi went into the “house” where the family was staying. So our traditional Christmas manger scene of Mary, Joseph, and Jesus with the shepherds and the wise men is not accurate. The wise men did not come to see Jesus at the same place as the shepherds.
Matthew does not tell us exactly where Joseph and Mary were with Jesus when the Magi came. While the teachers of the law told Herod that the Messiah would be born in Bethlehem, and the Magi headed there initially, Matthew says that they followed the star to where Jesus actually was. This could even have been back in Nazareth in Galilee. Herod the Great ruled both Judea and Galilee, so Jesus was in danger from him even that far away. That is why an angel warned Joseph in a dream that the family needed to flee.