You can only 1031 rental properties. For primary properties you have to
Wait two years.
You can write off realtor fees or any home improvements (like finishing a basement). But if your home ha appreciated, say $80,000 in the last nine months, those write offs would only cover a small portion.