Apologies, 2 years was a typo - it's 3 years.
You can claim if you sell your main residence (classed as your first home, irrespective of where you actually live) within 3 years of the purchase of the new property. You can claim the refund within 12 months of the sale of the main residence.
@Trunkie is it still a 6 month window but 2 years to sort it tax wise? And from the date of sale of your next or old house?