FIFA eligibility rules

Any player ... who assumes a new nationality and who has not played international football (in a match (either in full or in part) in an official competition of any category or any type of football) shall be eligible to play for the new representative team only if he fulfils one of the following conditions: a) He was born on the territory of the relevant association; b) His biological mother or biological father was born on the territory of the relevant association; c) His grandmother or grandfather was born on the territory of the relevant association; d) He has lived continuously for at least five years after reaching the age of 18 on the territory of the relevant association.

Question: do you have to live in the country you play for in the world cup
Answer: yes