In Matthew, Bethlehem appears to be the home town of Jesus' parents, Joseph and Mary. After Jesus was born, Magi came following a star from the east to see the new Messiah, whom they found in a house in Bethlehem. But Herod was afraid that Jesus would become king in his place. (Since Herod died as an old man in 4 BCE, this would have to have been many years earlier, before Herod knew that his time was almost up.) Jesus and his family fled immediately to Egypt, while Herod had all the infants killed, in order to remove a supposed rival. After Herod died, the family returned, but then decided to migrate to Nazareth in Galilee.
In Luke, Nazareth was the home town of Joseph and Mary. After Jesus was born, shepherds came to see Jesus, whom they found in a manger in Bethlehem. A few days after the birth, his parents took Jesus to the Temple for circumcision, as was normal custom, then returned peacefully to Nazareth.
Both gospels, in the form that we have them today, say that Mary was a virgin, but also provide a detailed genealogy going back through Joseph and the great Zorobabel, son of Salathiel, to King David, but give totally different genealogies. They even disagree on the father of Joseph and the paternal grandfather of Zorobabel. They both disagree with the Old Testament genealogy for the kings of Judah.
Both gospels have an angel announce the divine conception of Jesus, but one gospel says the angel spoke to Mary, the other says the angel spoke to Joseph. Neither gospel author knew about account in the other gospel and the stories would not make sense if both were true.