Your thinking is largely valid.
"He is India prime minister" is wrong. The noun is "minister", so normally any other words that modify the meaning should be adjectives, like "Indian", and not another noun, like "India".
"He is India's prime minister" or "He is the prime minister of India" is correct and the most clear. You are telling us that he is a prime minister, and then you are identifying the country that he is prime minister of.
"He is the Indian prime minister" is also correct. Yes, it does have the potential to be ambiguous. If someone from India moved to, say, Australia, and then became prime minister of his new country, you could describe him as "the Indian prime minister of Australia". When Alberto Fujimori became president of Peru -- as you might guess from the name, a person of Japanese descent -- people in the U.S. sometimes said that Peru now had a "Japanese president". But I think "Indian prime minister" would normally be understood to mean the prime minister of India. It would only be if the context required another meaning that we would think it meant a prime minister of another country of Indian descent -- like if it was clear that we were talking about the prime minister of Pakistan. (Okay, not a likely example.)