According to the following Quranic verse and hadith, the knowledge of soul (ruh) is only with Allah. However, as explained later, there is evidence in the hadith on when the ruuh enters the human body and what happens to a soul after it departs the body after a person’s death.
quran verse on ruh
And they ask you [O Muhammad] concerning the rooh [the spirit]. Say: ‘The rooh: it is one of the things, the knowledge of which is only with my Lord. And of knowledge, you (mankind) have been given only a little.’ [Quran, Surah al-Israa 17:85]”
This following hadith is about the incident when the Jews asked Prophet Muhammad about Ruh and the Prophet replied after getting the divine inspiration.