The boom and bust of Net companies last year affected not only stock portfolios, but also the housing situation of thousands of New Economy employees. Many folks may have gotten in over their heads and bought expensive homes only to witness their dot-com employer -- and/or their portfolios -- sink like lead.

If you had to sell your home because your employer shut its doors, all may not be lost. You may be able to walk away with a modicum of tax savings. If, in turn, you bought a new home, you are entitled to certain deductions. So with tax season upon us, let's take a look at how you can make the most out of your (overzealous?) buying and selling moves.

Dumped a Dwelling

Unless you sold your home in 2000 for a ton o' money, don't expect to be using those extraneous selling costs to offset -- or reduce -- your gain on the sale. That's because, thanks to the home sale rules enacted in 1998, you might not have a taxable gain at all.

As a refresher, the new home sale rules say that as long as your home was your principal residence and you owned it for two of the past five years, you will not pay tax on the first $250,000 gain generated from that sale, if you're single. If you file as married filing jointly, then you can exclude up to $500,000. That means if you're a married couple who bought a home for $200,000 and sold it for $600,000, you will not owe a dime on that $400,000 gain. But if you sold the home for $800,000, you would have to report a $100,000 taxable gain on your tax return.

Note that any commissions, legal fees or other expenses you paid related to the transaction simply reduce your sale price, according to Martin Nissenbaum, director of income tax planning at

Ernst & Young

. Those expenses are not reported separately on your tax return.

But what if you bought a home in February and realized -- once your dot-com employer went under -- that you could no longer afford it? Basically, you have two options.

You can always rent it to someone else, suggests Bob Trinz, editor at

RIA

, an information provider to tax professionals. But that assumes you have another place to live (I guess you can always call Mom).

Or you can sell it. But, in this instance, that would mean you were not in the home for two of the past five years. If you were fortunate enough to sell your mansion on a hill for a gain in that short period of time, would the whole amount now be taxable?

Maybe not.

You may qualify for a partial exclusion of that gain.

Here's how: If you are selling your home because of a change of employment, for health reasons or anything else the

Internal Revenue Service

considers an "unforeseen circumstance," you may qualify for a partial exclusion, says Trinz. (Check out

Section 121 of the tax code for more technical jargon.)

What constitutes an "unforeseen circumstance?" Who knows? The IRS has yet to define that. (Typical.)

You probably can make the case that being fired or laid off constitutes an unforeseen circumstance. If your dot-com employer folds and you have to move as a result -- even if you are only downsizing your home -- you would probably qualify for a partial exclusion, says Nissenbaum. But if have to sell your home because your portfolio tanked, you can forget about trying to get an exclusion.

If you do qualify for a partial exclusion, you'll have to do a little math to calculate the amount. First, divide the number of days you lived in the house by the minimum required two-year period, or approximately 730 days. That fraction is then multiplied by the married-filing-joint exclusion of $500,000, or $250,000 if you're single, to get the amount that you can exclude from capital gains.

Big note: Some states follow these home sale rules, others don't, Trinz reminds us. So be sure to check your local laws, or you may get hit with a big unexpected state tax bill.

What if you sold your place at a loss? Sorry, but you can't claim that loss on your tax return. Nor can you deduct your legal fees, sales commissions, etc.

The only good news if you sold at a loss is that if you refinanced your mortgage at some point, you may have some "unamortized points" sitting around. Points (a.k.a. loan origination fees, maximum loan charges, loan discount or discount points) are charges paid to obtain a home mortgage, usually payable at closing. One point represents 1% of the face value of the mortgage loan.

When you refinance your mortgage and pay points, you may spread those points over the new life of the loan. That means they are amortized, in accountant-speak, so only a portion of those points will be deductible each year. But if you sell your house and still have unamortized points, you can deduct all of them on your tax return, says Nissenbaum.

Purchased a Place?

If you bought a home in 2000, fortunately, you may end up with more deductions on your tax return. Any real estate taxes or mortgage interest paid in 2000 are deductible on

Schedule A

-- Itemized Deductions

.

In addition, if you paid points in conjunction with your mortgage to buy your primary residence (not a vacation home), you can deduct those points -- but only if you paid them at the closing and there are no hidden fees buried in the amount.

But all the extra expenses, like attorney fees, survey fees, broker commissions, etc., are added to the cost basis of your home, cautions Nissenbaum, and are not deductible on your tax return.

Also, don't forget that any improvements or additions you make to your home are also added to its basis. So if you upgraded the bathrooms, put on a new roof or put down a new patio, all those costs will be added to your original basis, which will help reduce your eventual gain. So it's imperative that you save all these records -- not only your purchase/sale stuff, but also all the documentation from your home improvements.

Where's Waldo?

As an aside, remember that when you move, you should file

Form 8822

-- Change of Address

with the IRS because it uses the address on your most recently filed tax return. Technically the IRS can update your records with the post office, but don't rely on them to get your current address.

I know firsthand that buying and selling a home can be a very emotional decision. Should you move out to suburbia? Uproot the kids? Take that job relocation offer? It's enough to make you sick. So while it's important to understand the tax laws and potentially benefit from them, please try not to let them play a role in your decision process.

Move into that new home because you love the kitchen, not because you'll get a mortgage interest deduction.

Send your questions and comments to

investorforum@thestreet.com, and please include your first and last names. Investor Forum appears Tuesdays, Thursdays and Saturdays.

As originally published, this story contained an error. Please see

Corrections and Clarifications. TSC Investor Forum aims to provide general investment information. It cannot and does not attempt to provide individual advice. All readers are urged to consult with a professional as needed about their individual circumstances.