One thing that is missing from other answers is cash vs accrual accounting. Cash accounting is typically only done by small businesses and ones that do not have the same timing challenges as a SaaS company. The largest difference is the cash received from a customer and the deferred revenue created. As a simple example... You have one customer who pays you $1 million on July 1 for 12 months of service. Let's further assume your operating expenses and cash paid for this 12 months of service is $700k (ratable monthly). As a cash payer would record in year 1, the taxable income of $650k and a loss of $350k in year 2. An accrual tax payer would have taxable income of $150k in both years. There are other financial statement impacts, from converting from cash and accrual accounting methods.
Taxes are assessed at 3 levels: federal, state, and municipal. We will disregard employment and sales taxes for these purposes. Broadly speaking, you will not have to pay full double taxation in two countries. The taxes paid to the foreign country will receive a credit or a deduction by your home country. Secondly, international sales can involve transfer pricing to a subsidiary which will impact the profitability in the foreign country. This is the point where you will want to consult a tax professional who is familiar with your product and the tax regulations of the countries you are doing business with.