In the Personal Info section of TT, your State of Residence is the state or country where your domicile (your main, primary home) was located as of the end of the tax year.
If your domicile was in a foreign country, scroll to the bottom of the State of Residence drop-down window and choose "Foreign or U.S. Possession".
Generally, if you kept your home in the U.S. and lived temporarily in another country (to attend school, for example), your State of Residence would still be your U.S. state. But if you abandoned your U.S. home and literally moved to another country with the intent of making it your home, that new country would be your "State of Residence".
If you're active duty military and you're stationed abroad on PCS orders, your State of Residence is your military SLR (State of Legal Residence).