They all say that Mary and Joseph were homeless, too.
That drives me crazy. Joseph and Mary had a home in Nazareth, and in Bethlehem, they were staying with Joseph’s relatives.
Joseph was an independent businessman, a carpenter, and was simply obeying the greedy Roman government’s edict that required everyone to go to the place of their family’s origin so they could be counted on the tax rolls. Rome was a super power that ran on the taxes of their conquered countries.
Jesus was not a refuge until he was taken to Egypt to avoid being murdered by another government run amok, King Herod, who was so afraid of losing his pathetic little throne in a vanquished country after hearing about Jesus from the Wise Men, that he ordered the killing of all boys two years old and younger. But God rules the world, and Jesus was spared to sacrifice Himself later as God willed it.