Deductions & credits

Hello Karen, thanks for your reply.
I completely left NY after Aug 1st, 2017 and did not maintain my residence (domicile) there after.
This is mainly due to I was under F-1 visa (international student) status and my visa was almost expiring that time, thus I left the country completely.  
Is this mean I should choose Foreign for "State of residence (on December 31, 2017)"?

Also, if I am not residence of NY, can I put the US mailing address (address of my friend or my previous workplace) or I have to use my current foreign address?

Thank you.