Here is a table I made describing how to determine if somebody qualifies as a child or relative for exemption purposes on the 1040. I made this last fall for the tax course I took as part of my master’s degree. The TA liked it so much that he included it as part of the next lecture as review. That made me feel really good.
In all cases, the person must be a citizen or resident of the United States, or a resident of Canada or Mexico.
This information is testable on the current CPA exam. I am not sure if this is changing with the Trump tax law changes. If it is, I will post an update once I know what those details are.