Collecting Rainwater in barrels or tanks for personal use is not really illegal in any states and you can legally collect the rainwater that runs off your roof, gutters, and any water that runs into buckets.
What is illegal though is to dam up creeks, rivers and other bodies of water to block the flow of the water and keep all the rainwater yourself.
You must allow the water to flow freely through creeks and rivers that run through your property but you can still collect and use some of that rainwater for personal use.
You just can't collect all the rainwater such as from the creeks and rivers but it's not illegal to actually just collect some rainwater that runs off your roof or from the creeks.
You can also place buckets outside to collect rainwater in those buckets and that would not be illegal.
However the states Arizona, Colorado, Oklahoma and Utah have more restrictions on the collection of rainwater.