Carl
Level 15

Investors & landlords

I think you're looking at the capital gains exclusion rule for this, and either you've never actually read it, didn't understand it correctly if you did, or are not aware of the special circumstances for active duty military. PCS orders to another state or country doesn't mean you can retain the property in a "my primary residence" status. Being on military orders, you don't have to.
When you sell the property, if it was your primary residence for at least 2 years (730 days) of the last 5 years (1826 days) you owned it, counting back from the closing date of the sale, then the gain on the sale (up to $250K if single or $500K if married) are exempt from taxation. The days you lived in it at your primary residence do not have to be consecutive either, provided all those days are within the last 1826 days you owned the property, counting back from the closing date of the sale.
There is a special rule for active duty military, such as yourself.

If you are forced to vacate the property due to military orders, then the day count is suspended until any one of three things happen.

1) A maximum of 10 years pass since you vacated the property

2) You retire or separate from the military

3) You return to the area on Permanent Change of Station orders. (TDY orders and leave do not count for this)

If you had to vacate the property under government orders prior to meeting the 2 year (730 days) residency rule, then you will qualify for a partial exclusion of 1/24th of the full exclusion, for each month you did live in the property.
Now take special note here, that the day count for either the occupancy period or ownership period is not "extended". It's "suspended" while you are away.  So if you lived in the house for 23 months, were away for say, 7 years and while still away you decided to sell the property while it's still classified as a rental. Your ownership period is 7 years, plus the 1 year 11 months you lived in it.

Your residency period is 23 months of the 7 years you owned it, and since your "day count" for the 5 year look back on residency (not ownership) stopped on the day you departed the area, you would qualify for a 23/24's exclusion of any capital gain realized on the sale.
If you returned to the area after 7 years and moved back into the house as your primary residence, then after living there for 1 month you would qualify for the full exclusion amount.

So converting only part of the property to rental doesn't mean the unconverted percentage is your "primary residence". Note there is a difference between primary residence, personal u se property, 2nd home, and the such.
Now if you already met the 2-year primary residence requirement, there's still no need to only convert part of the property to a rental. Your "day count" for the residence look back stopped on the date you departed the area. Technically speaking, it stopped on the date the movers picked up all of your household goods, if you checked into a hotel that night and have paperwork to prove it. I'm sure you have the paperwork, as you had to turn in receipts at the new duty station to "settle up" with the military for your moving expenses.