In general, H1B working visa does not really have relationship with my tax status, right?
That is correct.
The two tests are the green card or the substantial presence.
If you do not meet substantial presence in 2013 you file as nonresident alien despite filing as resident in prior years due to substantial presence.
Unless you qualify under one of those two tests then you are not allowed to file as a resident alien (despite any implication that may or may not have on immigration status which is a question for the immigration lawyers).
As you seem to know the substantial presence requires you must be physically present in the United States on at least:
For more detail see http://www.irs.gov/Individuals/International-Taxpayers/Substantial-Presence-Test
If you and your immigration lawyers decide that it is important to file as a resident alien for 2013 you will have to be physically present in the United States for at least 31 days to be able to use the resident filing status. Less than 31 days in the United States and no green card means you must file as a nonresident alien.
Please ask if you need more discussion or clarification.
Thanks a lot for the reply! Just to follow up on "substantial presence", the two conditions need to be both met in order to pass this test, right? For example, if I am physically in the US for LESS than 31 days in 2013, even though I stay MORE than 183 days during the 3-year period (using the formula above), I will still fail the substantial test, right?
Got it. Then in this case, I will definitely stay less than 31 days in 2013 thus have to file as a non resident alien. To be aligned with this status, is it also advised that I should submit W-8BEN forms to all my bank accounts and brokerage accounts so that they can also update my tax status in their system and their year-end reports to government accordingly? Thanks.
Indeed you've got it!
Thank you for the opportunity to be of service and your positive ratings.