It is tricky timing to sell just at the right time. One option is to purchase your new home with a contingency in the contract for the sale of the current house. But in this market, many sellers will not wait indefinitely. It is good to have a plan for what you will do if there is a gap. You can also get a bridge loan from the equity in your house to assist. Sometimes short term housing arrangements will work as well.
You can negotiate a move out date when you get a contract on the home you are selling. Sometimes, if you need more time, you can even lease back the home from the purchaser for a short amount of time.