-Microsoft develops product in U.S, generating tax credit for R&D.
And paying salaries to U.S. employees who pay income tax on it and spend their money in the US, thereby also paying US sales taxes.
-Microsoft shifts ownership, or "Profit Rights" of product off-shore, to say....The Bahamas.
Which only makes sense, since the US is one of the few countries in the world to tax people's oversea earnings. Only makes sense then that people and companies would move those profits offshore. If tax policies in the US were more reasonable, Microsoft wouldn't have to do that.
-Microsoft Bahamas subsidiary sells U.S developed product to Americans.
On which those Americans pay sales tax.
-Microsoft Bahamas claims all profit. Microsoft America gets all Tax Credits.
But as you said in your first part: the tax credits are for R&D, not for making profits!