Your quote from the 8949 instructions starting with gain is confusing because you are only looking at part of the sentence:
Report the sale or exchange on Form 8949 as you would if you were not
taking the exclusion. Then enter the amount of excluded (nontaxable)
gain as a negative number (in parentheses) in column (g). See the
example in the instructions for Form 8949, column (g)"
You also have to look at the rest of the row in the table:
You sold or exchanged your main home at a gain, must report the sale
or exchange on Part II of Form 8949 (as explained in Sale of Your Home
in the Instructions for Schedule D (Form 1040 or 1040-SR)), and can
exclude some or all of the gain
There is an example in the instructions. Unfortunately it is a complex one where there are two codes combined.
You sold your main home in 2019 for $320,000 and received a Form
1099-S showing the $320,000 gross proceeds. The home's basis was
$100,000. You had selling expenses of $20,000 that weren’t included on
your Form 1099-S. Under the tests described in Sale of Your Home in
the Instructions for Schedule D (Form 1040 or 1040-SR), you can
exclude the entire $200,000 gain from income. On Form 8949, Part II,
check box F at the top. Complete columns (a), (b), and (c). Enter
$320,000 in column (d) and $100,000 in column (e). Enter "EH" in
column (f). In column (g), enter $220,000 ($20,000 selling expenses +
$200,000 exclusion) as a negative number. Put it in parentheses to
show it is negative. In column (h), enter -0- ($320,000 − $100,000 −
$220,000). If this is your only transaction on this Part II, enter
$320,000 in column (d) on line 10 of Schedule D (Form 1040 or
1040-SR), $100,000 in column (e), ($220,000) in column (g), and -0- in
Pulling the parts relevant to your question, and making up some numbers, you would put
- the sale price in Column D, lets say $450,000
- The cost basis in Column E, lets say $150,000
- The code H in Column F
- The amount you can exude as negative number signified by parentheses: (200,000)
Column (h)—Gain or (Loss)
Figure gain or (loss) on each row. First, subtract the cost or other
basis in column (e) from the proceeds (sales price) in column (d).
Then take into account any adjustments in column (g). Enter the gain
or (loss) in column (h). Enter negative amounts in parentheses.
So using the numbers from above:
450,000 - 150,000 + (200,000) = $100,000 in gains that is subject to tax.