This question is for a friend. They came to the United States as a student in 2009 on OPT/F-1 visa. In November of 2011 they started to work for the Department of Defense as a teacher. They had Social Security and Medicare taxes withheld and not refunded. In August of 2012 they were converted to an H-1B visa.
Should they have been refunded the Social Security and Medicare taxes that were withheld for 2011, and possibly 2012? It seems to depend on whether they were considered a resident or nonresident alien for those tax years, according to this. The Substantial Presence Test says as an F-1 student they are exempt. Would this count for 2011 and 2012, or just 2011? If they are due a refund, how should they go about getting it?