A fairly common mistake for English language learners from certain countries is to say something like, "I am a French" or "I am a Spanish", which is incorrect (today you would say "I am French/Spanish" or "I am a French/Spanish person", or to a lesser extent "I am a Frenchman/Spaniard"). However, there are many examples of demonyms whose adjective form can be used as a noun, e.g., "I am an Italian/Iraqi/Russian", but not "I am a French/Chinese/Danish" (well, you can say 'I am a Danish,' but that has an entirely different meaning).
Just from thinking about examples, it seems to me that the rule is:
If you can form a demonym with -an/-ian/-i/-ite, you may use it as a noun, otherwise, it is only an adjective.
Does this hold in general? Are there notable exceptions to this rule (in either direction)?