Thank you for the responses.
Here is my situation with some more specifics. Any additional help you guys can provide is greatly appreciated.
I was on F-1 from January 1998 to Aug 2001 and then again from August 2005 to December 4th 2007. So that makes it more than 5 years on F1 visa. Do the 5 years have to be consecutive or do my 5 inconsecutive years make me a resident?
I changed to H-1b on December 4 2007. The way I understand the rules from Pub 519, I cannot use December 4th as my start of residency date because I did not have 31 days in the US with that visa. If I am a non-resident for tax purposes, I need to get back a ton of money because FICA was being withheld from my paychecks. What is the best way to get that refunded?
Thanks again.