All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and Messenger.
We will answer your questions with the following points:
First, some houses may actually be inhabited by jinn or at least visited by them. Abu Sa‘eed reported that the Prophet, sallallaahu ‘alayhi wa sallam, said: “Vermin (venomous creatures like snakes) are among the jinn; so if anyone sees one of them in his house, warn three times that if it returns he will kill it.” [Abu Daawood]
Second, the harm that the devils can inflict upon humans could reach the extent of killing. It has been reported that a young man from the Ansaar was killed by demons as reported in Muslim's Saheeh. Part of that long narration reads: “He entered and found a big snake coiled on the bed. He darted with the spear and pierced it and then went out and fixed it in the courtyard, but the snake quivered and attacked him and no one knew which of them died first, the snake or the young man. That was mentioned to the Messenger of Allaah, sallallaahu ‘alayhi wa sallam, and people asked, "O Messenger of Allaah, ask Allaah to bring the young man back to life." He, sallallaahu ‘alayhi wa sallam, said, "Ask forgiveness for your companion." He, sallallaahu ‘alayhi wa sallam, added: "There are jinn in Madeenah who have entered Islam, so when you see any of them, warn it for three days, and if it appears after that, kill it for it is a devil."”
Third, each person departs this world at his due time which was determined by Allaah The Exalted; Allaah says (what means): {And for every nation is a [specified] term. So when their time has come, they will not remain behind an hour, nor will they precede [it].} [Quran 7:34] ‘Abdullaah (Ibn Mas'ood) narrated that Umm Habeebah said, “"O Allaah, provide me my husband, the Messenger of Allaah, sallallaahu ‘alayhi wa sallam, and my father Abu Sufyaan and my brother Mu‘aawiyah for as long as I live." The Prophet, sallallaahu ‘alayhi wa sallam, said: "Verily, you have asked Allaah for times that have been determined, days that have been numbered and provisions that has been allotted. Nothing occurs ahead of its time and nothing is delayed beyond its time."” [Muslim]
Allaah The Exalted decrees that each person dies due to a given cause. A person could die from an illness, from getting killed or any other cause. One should not say, If only so-and-so moved to another house, he would not have been killed, because we do not know what Allaah has determined for this person. If Allaah has determined that this man will die in this house, he will die in it as Allaah has determined for him, and if he was meant to live any longer, he would not have died then.
Fourth, after the soul depart the body, it moves to the intermediary realm of Barzakh. It will be either punished or blessed as reported in the texts. A long Hadeeth reported by Al-Baraa’ ibn ‘Aazib about death that was cited in Musnad Ahmad underlines this fact. After death, the soul does not move to another living person’s body. For more benefit, please refer to Fatwa 10565.
Fifth, despite the facts highlighted above regarding the houses and how they may be inhabited by jinn and devils, this should not be necessarily associated with the incidents mentioned in the question. In general, a Muslim is enjoined to protect his house against the evils of the jinn and demons by reciting the reported Athkaar (words of remembrance) and the Quran. Abu Hurayrah reported that the Prophet, sallallaahu ‘alayhi wa sallam, said: “Do not turn your houses into graveyards. Satan runs away from the house in which Soorah Al-Baqarah is recited.” [Muslim] A Muslim should ask Allaah to bless him with safety and protect him from all tribulations. The reported supplications and Athkaar to be recited in the morning and evening include similar Athkaar to that effect.
Sixth, if a Muslim dislikes living in a certain place, then he should move to another one, not out of pessimism or belief in bad omens, but to spare himself from thinking too much about such matters. He is advised to move out in order to put an end to the doubts he may be having and to devote his efforts and attention to what benefits him. Please refer to Fatwa 136033 as it gives a detailed explanation of the Hadeeth that reads, “If there is actually an evil omen, it is in the woman, the house, and the horse.”
Allaah Knows best.