Usually 6 months--some lenders will say 12 months. There is a lot of work done in a refinance, not to mention money paid to do the loan, so the lender wants a chance to recoup this money. They do not want to do a loan today and have it paid off in a month's time because all the signs were there that this house was up for sale and will be back up for sale shortly after the refinance.
Now some lenders--if you are up front as to the whys: why the house was up for sale, why it is off the market, and why you are doing the loan in the first place, the lender may make an exception. To find this lender--when you are calling be up-front about needing an exception due to the house being on the market, do not give your Social Security number and an application- if they didn't answer your question. Everyone can get an answer before forehand. You want an exception to the rule due to........(add your reasons. Talk to a reputable broker as most of us will not string you around and we work for our money. Since they work with several lenders they may know of a lender that will make the exception. Good Luck