"If you have gain that can't be excluded, you generally must report it on Form 8949, Sales and Other Dispositions of Capital Assets, and Schedule D (Form 1040), Capital Gains and Losses. Report the sale on Part I or Part II of Form 8949 as a short-term or long-term transaction, depending on how long you owned the home. For more information, see the Instructions for Form 8949."
If you don't meet the 2 out of 5 year test for exclusion, you can still partially exclude the gain for work-related, health-related, and other unforeseeable events (casualty losses and natural disasters) which may have caused you to move.