The Census of Quirinius was a census of Judaea taken by Publius Sulpicius Quirinius, Roman governor of Syria, upon the imposition of direct Roman rule in 6 CE. The Jewish historian Josephus portrays the annexation and census as the cause of an uprising which later became identified with the Zealot movement. The author of the Gospel of Luke uses it as the narrative means by which Jesus was born in Bethlehem (Luke 2:1-5), and places the census within the reign of Herod the Great, who actually died 10 years earlier in 4 BCE. No satisfactory explanation has been put forward so far to resolve the contradiction, and most scholars think that the author of the gospel made a mistake.
Census of Quirinius Wikipedia
In 6 CE Publius Sulpicius Quirinius (51 BCE-21 CE), a distinguished soldier and former Consul, was appointed Imperial Legate (governor) of the province of Roman Syria. In the same year Judea was declared a Roman province, and Quirinius was tasked to carry out a census of the new territory for tax purposes. The new territory was one of the three portions into which the kingdom of Herod the Great had been divided on his death in 4 BCE; his son Herod Archelaus was given Judea but complaints of misrule prompted his removal and Judea and Samaria were placed under direct Roman rule, although Galilee and other areas remained autonomous.
The Gospel of Luke places the birth of Jesus under the reign of Herod (37 BCE - 4 BCE) - "In the days of King Herod of Judea..." (Luke 1:5) and links it to the census of Quirinius:
In those days a decree went out from Emperor Augustus that all the world should be registered. This was the first registration and was taken while Quirinius was governor of Syria. All went to their own towns to be registered. Joseph also went from the town of Nazareth in Galilee to Judea, to the city of David called Bethlehem, because he was descended from the house and family of David. He went to be registered with Mary, to whom he was engaged and who was expecting a child. (Luke 2:1–5)
There are major difficulties in accepting Luke's account: the census in fact took place in AD 6, ten years after Herod's death in 4 BCE; there was no single census of the entire empire under Augustus; no Roman census required people to travel from their own homes to those of distant ancestors; and the census of Judea would not have affected Joseph and his family, living in Galilee; most scholars have therefore concluded that the author of Luke's gospel made an error.