1040 or 1040NR - H1B visa holder
I am an Indian citizen who was working in the US on an H1B visa till Aug 2007 and have filed using the 1040 form in 2006, 2007. After that I was seconded by my US company to country X for an expat assignment from Aug 2007 till Jan 2009. During my assignment in country X, I was still being paid by my US based company and I was still on the payroll. The company that I was seconded to paid for my taxes in country X. While I was in country X, I got married to an Indian citizen and we visited (spouse on a H4 dependent visa) the US only once in 2008 for just 11 days.
My wife and I returned to the US after my assignment in Jan 2009 under the H1B/H4 visa status. Now as I was trying to figure out how to file my taxes, I have found out that would fail the substantial presence test and therefore would have to file the 1040NR.
I need assistance to -
1. Which form to file - 1040 or 1040NR?
2. Can I claim the foreign tax?
3. Can I claim my spouse as a dependent?
4. How to obtain an ITIN number for my spouse as she cannot obtain SSN?
Thanks.