The general rule: For most purposes, you are taxed in each state based upon your residence (or physical presence). The state where you spend more than 180 days during the tax year (equal to the calendar year, for most people) is your permanent residence. In other states, you can be taxed based on part-year residence. You would have to file tax returns for all states where you were resident (and generating income) during the year.
If you live in one state and have income generated from another state, you could have to file a return for that other state, even if you were not physically present there.
There are also tons of exceptions; for instance, Iowa, Wisconsin, Illinois, and maybe a few others have agreements about how to treat someone who lives in one state but has income generated in the other states.
Since the lottery is paid out over many years, you would be paying tax over many years, I presume. (Sometimes, if you get a large sum of money, you are taxed on the whole sum, even if the money is paid out in installments over many years.)
The main thing, however, would be to get tax advice BEFORE you claim your winnings. For example, in some states (I think Florida was one), your winnings are paid out over 20 years. If you die after only five years, your beneficiaries do not get the remaining 15 years of payments. Thus, you want the ticket to have been bought by your ‘trust fund’ which doesn’t die but endures after your death. There are a number of similar tricks, depending on where you live and so forth, that a tax advisor and financial planner would be pleased to help you with… for a small fee. In this case, the fee would almost certainly be worth it.
I hope that this horrible problem descends on you. I’ve always thought, I’d love to have the problem of having so much earnings that I have to pay millions in taxes.