That's right, you have to be married filing jointly to get the $500k tax free. You know what though, there are some very lenient rules around that law that you wouldn't expect. Of course before 1997 the law was a once in a life-time $125k tax free gain from primary residence or you had to roll your profit into another home within 2 years of the sale. On the new laws it's $250k single or $500k married filing jointly. Where some people get confused is on residency requirements and 1031 exchanges. You'd assume that you could not convert an investment property you purchased on a 1031 exchange to a primary residence and get the tax break. Low and behold, YOU CAN. There are other requirements though. If you purchase on a 1031 exchange you have rolled profit from a previous BUSINESS investment into the purchase of your new like kind investment home....right? Well, if you own that house for 5 years live in it a total of 2 out of the 5 and the 2 years DO NOT have to be in a row and you don't have to be living in the home at the time you sell it, you qualify for the write off. In fact, any primary residence sale that you're going to try to avoid capital gains tax you only have to occupy the residence a TOTAL of 2 out of the previous 5 years, sequential is not a requirement and you don't have to be living in the home at the time of the sale.
Another freaky thing about the law is let's say you're single when you buy a home, you live with someone but you're not married, you occupy the house say for a year and a half and then get married 6 month before you sell. You're then married at the time of sale, the now spouses both lived there for 2 years, you can sell and take the $500,000 tax free.
You can't take excercise this deduction more than once every two years. But, you could live in multiple homes and even acquire homes through like property exchanges and as long as you own those homes 5+ years have investment properties, and multiple personal residences and take $500k every two years tax free if you buy right.