When Joseph and Mary had done everything required by the Law of the Lord, they returned to Galilee to their own town of Nazareth. Luke 2:39
After they had heard the king, they went on their way, and the star they had seen in the east went ahead of them until it stopped over the place where the child was. When they saw the star, they were overjoyed. On coming to the house, they saw the child with his mother Mary, and they bowed down and worshiped him. Then they opened their treasures and presented him with gifts of gold and of incense and of myrrh. Matthew 2:9-11
Luke 2 explains what happened after the child was born in Bethlehem and dedicated in Jerusalem. They went back to Nazareth. Matthew 2 explains what happens when the wise men stopped in Jerusalem, talked to Herod, then followed the star which appears to shift from Bethlehem to Nazareth.
Now the Joseph family lives in a house in Nazareth.