You must pay taxes in every state in which you are incorporated/organized/chartered AND where the corporation actually resides (headquarters, major offices, etc).
How is it determined where the corporation "resides"? I know for a physical company, it is where ever I am physically located. But what about a purely online company?