I say, with Allah's guidance: First: Puberty: Prayer is not obligatory for a child, as there is no legal responsibility upon them. Second: Sanity: Prayer is not obligatory for an insane person, as they are not accountable; as Ali, may Allah be pleased with him, reported that the Prophet, peace be upon him, said: 'The pen is lifted from three: from the child until they reach puberty, from the sleeper until they wake up, and from the insane until they recover.' This is found in Sunan Abu Dawood 4:140, Sunan An-Nasa'i Al-Kubra 4:324, Musnad Al-Tayalisi 1:15, and Musnad Abi Ya'la 1:440. Third: Islam: Prayer is not obligatory for a non-Muslim, as Islam is a condition for being addressed with the branches of Sharia, and the non-Muslim is not among the people of Islam. See: Maraqi Al-Falah p.173, and Allah knows best.