We moved last year due to a PCS (military)and sold our house but we were there less than 2 years how will i enter that so i dont pay the capital gains tax?

I know military is not made to pay this tax due to PCS i just want to make sure I do this part right on our tax form as ive never done it before.