First, get their timeline as this conversation may be a moot point. If they're just now batting around the idea of house hunting, it may be several months (or more) before they're ready to pull the trigger.
If the timeline is short, this sounds like a great opportunity as renting in 5 months will likely be tougher.
I do think that @Michael Smythe has a good point about having the upper hand legally. For me, that isn't my preference. I would rather have a good break lease fee and let them go. I feel like there's a better chance I'll get that than someone paying me rent 4 months after they moved out. There are also potential issues with it being vacant too long from an insurance perspective (they prefer 90 days or less in my experience); although, this is low on my list of concerns. If I'm going to rehab a unit to get top rents, it also gets a little dicey to "rehab on their time/dime" if they're paying rent. Again, I don't like to draw out tenant relationships once they've moved out of a property.
Once you have their timeline, maybe ask if they'd like to pay a break lease fee of a month (or whatever amount you decide) with 30 days notice. That lets them budget for their new house/mortgage, so I believe it would be attractive. I'd make it clear that the security deposit doesn't count as the fee - that will be returned after assessing damages. In theory, this gives you a paid month to find a new tenant and/or do any rehab/updates you'd like. :)