The phrase "put a spirit in him" means that God will influence him to make a specific decision. The word "spirit" here means a strong attitude or feeling. Alternate translation: "I will influence him so that when he hears a certain report, he will go back to his own land" (See: [[rc://en/ta/man/jit/figs-idiom]])
The phrase "fall by the sword" is an idiom that means that his enemy will kill him with a sword. Alternate translation: "And there in his own land, I will cause his enemies to kill him with their swords" (See: [[rc://en/ta/man/jit/figs-idiom]])