Will I owe capital gains tax on this sale?
I have lived in my single family house for a little over 2 years. I rented the apartment above the garage out for 1 year. I was thinking of 1031 exchanging 20% of the proceeds from the sale (20% because that is how much of the house was rented) but am curious to know if I will owe capital gains tax on a portion of the remaining proceeds since I didn't occupy the whole house for 2 years. If so, what percentage of the proceeds for the primary residence portion would be taxed?
Also, what can I do if there is a huge tax penalty to offset this?