The actual text of the 14th Amendment...
All persons born or naturalized in the United States, and subject to the jurisdiction thereof, are citizens of the United States and of the state wherein they reside.
At the time of drafting, the term "subject to the jurisdiction thereof" meant something quite different than it has come to mean today. Essentially, people who were in the USA illegally were not considered under the jurisdiction the USA, they were considered under the jurisdiction of their native country and, if caught in the USA illegally, would be deported therefrom to the country of their proper jurisdiction.
The two legislators primarily responsible or drafting the amendment made this quite clear in their correspondence and official remarks.
However, somewhere along the way, nobody knows exactly when or where (according to a Claremont professor who is expert in the 14th and appeared on the Mark Levin show), the State Department started recognizing such births an issuing passports.
Thus, acoording to the original intent of the 14th Amendment, anybody who is born on US soil of parents legally in the USA is eligible for US citizenship.
In 1868 how did you determine if someone was in the country legally or illegally?