They are two separate items but related so I will answer them separately.
In general, a gain is the purchase of an item at one point to then sale it at another point for an increase. A loss is of course the opposite, selling later for less. How the gain or loss is categorized depends on the context in which it is used. I am making the assumption that you are referring to capital gains (or losses) from a US tax perspective since you referred to the “$250,000 exclusion”. Under the tax code gains (or losses) are either ordinary or capital in nature, so the purchase and sale of a capital asset would either result in a capital loss or capital gain. Your personal residence is considered a capital asset. The law does not allow for you deduct (or write off) capital losses on your home in the normal course of most real estate transactions. However the law does require any gains be included in your gross income as capital gain proceeds.
The exclusion you were referring to is the Code Sec. 121 Exclusion. This exclusion allows an individual to exclude from gross income (thus taxable income) $250,000 (or $500,000 for a joint return) of the capital gain on the sale of a residential real estate. There are obviously many rules and exceptions to the exclusion but the main one for general purposes is: 1) it was your principal residence for an aggregate of two (2) of the last five (5) years and 2) you must have owned for those two years. For example, on January 1, 2000 you bought your home for a total of $200,000 then sold it on January 2, 2002 for a net of $450,000 after living in the whole time. The capital gain of $250,000 is excluded from your gross income. Using the same example, if the net sales price were $500,000 then you have to report a capital gain of $50,000 on your tax return for that year. Lastly using the same original example, if you lived in the home all but the last two months then the wording of the law requires you to report a $250,000 capital gain on your return instead of zero (0).
I hope this is a clear enough answer for you but remember the IRS and Congress wrote a book on the subject so each situation is unique and may differ from the information I have provided. Always consult a tax professional before filing any return in which you have doubt.