With regard to children born in territories (e.g., Guam): The Congress decides. They could be “U.S. Nationals” and NOT citizens. They could be citizens.
Acts of Congress making persons born there U.S. citizens at birth:
P.R. - 1917
U.S. Virgin Islands - 1927
Guam - 1950
In some cases, the law or subsequent laws made the provision retroactive to a prior date. Similar laws at one time pertained to Alaska and Hawaii. The Panama Canal Zone was never an incorporated territory, so citizenship at birth was only transmitted by lineage, not by place.
The rule is (or should be) this: are the destinies of that place and the U.S. sufficiently intertwined. Clearly, we and the people of P.R. are not so intertwined to be a common people. But, many Puerto Ricans serve in the armed forces and in other ways evidence shared interests and values.
And they could be aliens. The naturalization acts that pertain to Puerto Rico, Guam and the Virgin Islands do not specify that either parent must be a US citizen, nor that either parent have ever resided in one of the 50 states.