I was on F1 from Aug 2013 to Jul 2015 and on F1-OPT from Sep 2015 to Feb 2017. My status was changed to H1B in Feb 2017. My employer withheld the FICA tax starting from Feb 2017. Do I exempt from the substantial presence test for 5 years (2013-2017)? Can I get the refund of FICA if I file as a non-resident alien?
As a F-visa holder, you are exempt from counting days and treated as a nonresident for 2013-2017. When you switch to H-1B in February 2017, you become a resident from February 2017 and make yourself a dual-status alien. While you are a nonresident, you are exempt from paying FICA. You will start paying FICA after February. To claim a refund of the FICA you have paid, you should contact your employer. If you are unable to get a full refund from your employer, you can request the refund from the IRS by filing a Form 843. For more information, please see More Form 843