According to the Olympic Charter (Rule 40-41) Any competitor in the Olympic Games must be a national of the country of the NOC which is entering such competitor. A competitor who is a national of two or more countries at the same time may represent either one of them, as he may elect. However, after having represented one country in the Olympic Games, in continental or regional games or in world or regional championships recognised by the relevant IF, he may not represent another country unless certain circumstances. All matters relating to the determination of the country which a competitor may represent in the Olympic Games shall be resolved by the IOC Executive Board.
Learn more:
The Olympic Charter: Chapter 2, Rule 41.