@Mason Vitalis
Oh, where to begin...
Sale of a flipped/rehabbed property is considered by the IRS as dealing in inventory. So, the profits (generically, sales price minus cost basis or prucahse price) are taxed as ordinary income also subject to self employment tax.
Sale of an investment property, i.e. one that was rented, is considered capital gains.
It is your intent of the property that signifies which taxation applies. You can take 2+ years to rehab a property. Its still dealing in inventory. However, if you rehab a property, rent it out, and say in a 1.5yr you decide to sell, its an investment. Your intent should be to rent the property as an investment, not to change its taxation.
"Reinvesting" the funds doesn't change taxation. Neither does the amount of loan that you have on the property. Again, your profit is the sales price minus your cost basis. What you do with your money is your business, except the IRS wants its percentage of the profit (well, less any other deductions that apply).
Don't forget that investment properties have to take depreciation. Even if you didn't take depreciation on your tax return, you will still have to pay that back up to 25%. So, while "they" "sell" you on the benefits of depreciation, its really a tax deferrment.
This is all Federal taxation. Usually, the states follow pretty closely.
Hope this helps. Happy to chat. Good luck.