A couple things about the tax aspect of rentals and flip houses:
Flipping houses quickly becomes a business subject to ordinary income and self employment taxes. The IRS applies a facts and circumstances test, but suffice it to say if you are doing more than one per year it is probably a business not an investment. Investors usually hold things for appreciate and don't significantly alter their value by any means but the passage of time. You end up with the same treatment as a developer who converts an apartment building to condos. The houses become inventory. As such, you aren't permitted to depreciate them even if you rent them while trying to sell them. While the house is worked on you cannot deduct anything if it is unoccupied. The carrying costs get capitalized, which means you add them to the cost of the house in determining your profit at the end.
During any period the houses are rented, you are permitted all deductions associated with the property except depreciation. That means mortgage interest, real estate taxes, insurance, utilities, maintenance, management etc.
Living in a rental property for more than two weeks (or 10% of days rented per year) actually hurts your tax deductions.
Your income level and the relative time spent and money earned among non real estate activities are truly what drive the immediate tax benefits of real estate rentals. Most real estate tax benefits are an acceleration of deductions and consequently a deferral of taxes. If you have a vacation home that can meet the occupancy test above, you pickup some minor tax benefits. If you have multiple vacation homes and can qualify them as rentals, your tax benefits are a bit more.
In order to avoid capital gains tax on the first $250K or( $500K if married filing jointly), you have to live in a property for two of the last five years you own it unless you meet one of a bunch of exceptions that aren't really relevant to our discussion. However, if you rent the property out and depreciate it, you will pay tax on the depreciation taken after 5/5/97. So if you bought a property 10 or 20 years ago and rented it out ever since, you could validly move in for two years and only pay tax on the deprecation that you took in the last 11 years, but not the likely substantial capital gain that you would otherwise have. With some planning, a 1031 exchange can get you a property more to your residential tastes a few years before you move in.
As far as I am aware, all states that have individual income taxes recognize the federal exclusions.
It might be beneficial to set up two LLCs for real estate if you intend to rent any properties, one to do flipping and possibly management of the rentals and one to own the rental properties. If a property that you expected to flip becomes a rental, your lender would likely be ok with a transfer of the deed if the rental LLC and flipping LLC have the same ownership. Other options include one LLC for each property and Series LLCs if your state permits.