Technically speaking they were Israelite Refugees at the very most.
Movement within the ancient world was different to today. There really isnt any such thing as illegal immigration in the ancient world because there was very little in the way of understood boarder controls.
They were refugees because they were forced against their will to leave...but im not sure the Romans would understand that term either.
What IS interesting is the gap between The Birth and leaving the country. King Heord executed toddlers as well as babies. The one event happened years after the other event! people forget that Jesus was only in Bethlehem for forty days following his birth.
After that the couple will have left to have the child consecrated by the Temple...and give me one good reason why they would return to Bethlehem from there? They only went to Bethlehem to register...not to live.
By the time the Magi appeared the Scripture even says that the star remained over the house....the house...they did not sit in a stable for three years waiting for the wise men!!!
I suspect the reason they fled is because they were registered. If Herod is killing babies in Bethlehem and doesnt find the Christ, he will find out who are not in Bethlehem that were...and he will thus discolose the very name and family.
So Jesus family probably left NOT because they were residents of Bethlehem during the slaughter...but because Records dating back three years...INCLUDING the name of their new Kid..would be written in the Roman Records...and the moment that Herod discovered who and where they were, he would go get them...so they were not safe in his Jursidiction at all.
So...Number one....Jesus was only in Bethlehem for forty days maximum from birth
When the Magi arrived...they did not arrive in Bethlehem...or if they did...it was not at the Stable of the Birth...for they arrived a possible three years later. The star appeared on the day of the birth....and they followed it for years.
Number three they were not residents of Bethlehem during the slaughter, they left because they had been their for the census.
Number four, Herod could gain that information from the Romans and thus he could find them anywhere in the whole country
Number Five...there was no such thing as illegal aliens at the time...simply, Roman citizen, and non citizen...so at the very most, Jesus was a refugee, again...only for a few years
Number six...the real question is...were they Tax evaders
If the Roman Records had them living in one place and they were not there...how did they pay taxes during the Egyptian years...they must have sorted it out..or else when they returned....well the Romans would not treated them kindly