Mathew records them fleeing to Egypt, Luke does not
From Nazareth of Galilee to Bethlehem for the census back to Jerusalem for circumcision and then to Egypt to flee from Herod’s decree back to Nazareth to grow up until His ministry
Luke 2:21-39
Mathew 2:12-23
Hosea 11:1 ESV
1 When Israel was a child, I loved him, and out of Egypt I called my son.