In the case of United States vs Wong Kim Ark 169 U.S. 649 (1898) (a 6-2 decision), the Supreme Court wrote:
[T]he real object of the Fourteenth Amendment of the Constitution, in qualifying the words, "All persons born in the United States" by the addition "and subject to the jurisdiction thereof," would appear to have been to exclude, by the fewest and fittest words (besides children of members of the Indian tribes, standing in a peculiar relation to the National Government, unknown to the common law), the two classes of cases -- children born of alien enemies in hostile occupation and children of diplomatic representatives of a foreign State -- both of which, as has already been shown, by the law of England and by our own law from the time of the first settlement of the English colonies in America, had been recognized exceptions to the fundamental rule of citizenship by birth within the country.
[T]he Fourteenth Amendment affirms the ancient and fundamental rule of citizenship by birth within the territory, in the allegiance and under the protection of the country, including all children here born of resident aliens, with the exceptions or qualifications (as old as the rule itself) of children of foreign sovereigns or their ministers, or born on foreign public ships, or of enemies within and during a hostile occupation of part of our territory, and with the single additional exception of children of members of the Indian tribes owing direct allegiance to their several tribes. The Amendment, in clear words and in manifest intent, includes the children born, within the territory of the United States, of all other persons, of whatever race or color, domiciled within the United States.
To hold that the Fourteenth Amendment of the Constitution excludes from citizenship the children, born in the United States, of citizens or subjects of other countries would be to deny citizenship to thousands of persons of English, Scotch, Irish, German, or other European parentage who have always been considered and treated as citizens of the United States.
In short the phrase “and subject to the jurisdiction thereof” excludes three and only three groups of people:
Children born to foreign diplomats here on diplomatic business, who have diplomatic immunity to US Law;
Children of members of an invading army that has occupied and controlled some part of US territory, born on that occupied area, who are obviously not subject to US Law (which has rarely happened in the US, although Guam was occupied during WWII, and parts of Alaska, and small parts of Maine during the War of 1812); and
Members of Native American tribes, subject to the jurisdiction of their tribal governments, who do not pay US taxes. (This was true when the 14th amendment was passed, but it no longer is. See section below on the act that changed it in 1924.)
Any other person born in the proper US or in incorporated US territory is a citizen, no matter who his or her parents are or were. (The case is less clear for unincorporated US territory.)
See also the Wikipedia article on the case
This view was confirmed in 1995 in an opinion from the Justice Department’s Office of Legal Counsel written by then-Assistant Attorney General Walter Dellinger, taking the position that this rule could not be changed by legislation, only by Constitutional Amendment, writing:
My office grapples with many difficult and close issues of constitutional law. The lawfulness of this bill is not among them. This legislation is unquestionably unconstitutional. The Fourteenth Amendment declares that “[a]ll persons bom 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.” U.S. Const, amend. XIV, § 1. The unmistakable purpose of this provision was to constitutionalize the
existing Anglo-American common law rule of jus soli or citizenship by place of birth and especially to extend it to persons of African descent and their descendants.
In Plyler v. Doe, 457 U.S. 202 (1982) the Supreme Court of the United States struck down both a state statute denying funding for education to children in the United States illegally and a municipal school district's attempt to charge an annual $1,000 tuition fee for each student. The case upheld the same principle that the constitutional phrase "within the jurisdiction" applies to the children of people who had entered the US illegally.
According to the Wikipedia article on the case:
Texas officials had argued that illegal aliens were not "within the jurisdiction" of the state and thus could not claim protections under the Fourteenth Amendment. The court majority rejected this claim, finding instead that "no plausible distinction with respect to Fourteenth Amendment 'jurisdiction' can be drawn between resident immigrants whose entry into the United States was lawful, and resident immigrants whose entry was unlawful." The dissenting opinion also rejected this claim, agreeing with the Court that "the Equal Protection Clause of the Fourteenth Amendment applies to immigrants who, after their illegal entry into this country, are indeed physically 'within the jurisdiction' of a state."
Thus the question of whether such aliens were "within the jurisdiction" of the US was very much at issue in Plyler v. Doe
Since the Indian Citizenship Act of 1924 was passed, all Native Americans born within the US have been citizens by birth, and the third class of exceptions noted in the earlier cases non longer exists. Prior to this act Native Americans were in many ways treated as foreigners by the US. They were not citizens by birth, and their tribes had some but not all of the attributes of independent nations.
The text of the law is:
Be it enacted by the Senate and House of Representatives of the United States of America in Congress assembled, That all non citizen Indians born within the territorial limits of the United States be, and they are hereby, declared to be citizens of the United States: Provided That the granting of such citizenship shall not in any manner impair or otherwise affect the right of any Indian to tribal or other property.
(End edit on Indian Citizenship Act of 1924)
Edit: On reading through the decision of the case of Wong Kim Ark I find one more small exclusion: persons born on board a foreign naval ship, even though present in US waters in time of peace, are not citizens of the US because of their birth location. This is apparently not a usual case, but is premised on the ground that a military vessel remains the territory of the nation it belongs to. Such persons might of course be citizens by inheritance if one or both parents are US citizens, and the statutory conditions are complied with.
(End edit on naval ships)
I just learned that some parts of the State of Main were occupied by the British during the war of 1812. I do not know if anyone was born during that occupation whose citizenship might have been affected.