So it's not like the Olympics?  What is the determining factor of what team you can play for?  Is it different for each country or is it a FIFA rule?
		
		
	 
FIFA rule...per WIki:
In the 20th century, FIFA allowed a player to represent any national team, as long as the player held citizenship of that country. In 2004, in reaction to the growing trend towards naturalisation of foreign players in some countries, FIFA implemented a significant new ruling that requires a player to demonstrate a "clear connection" to any country they wish to represent. FIFA has used its authority to overturn results of competitive international matches that feature ineligible players.  [. . .] An emergency FIFA committee ruling judged that players must be able to demonstrate a "clear connection" to a country that they had not been born in but wished to represent. This ruling explicitly stated that, in such scenarios, the player must have at least one parent or grandparent who was born in that country, or the player must have been resident in that country for at least two years
[. . .]
The relevant current FIFA statute, 
Article 17: Acquisition of a new nationality, states:
[18]
Any Player who ... [assumes] a new nationality and who has not played international football [in a match ... in an official competition of any category or any type of football for one Association] shall be eligible to play for the new representative team only if he fulfills 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;
© 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.