There is no such limit on the number of times you can go for home refinance loans. Most lenders prefer that you have no late payment for the past 12 months before you switch over to a new loan.
If you know that you will be moving in 3 to 5 years, you might want to consider refinancing to a 3 or 5 year ARM (adjustable rate mortgage). These loans typically have a much lower rate that a traditional fixed rate loan such as a 30 year fixed, but they do have a fixed rate for the first 3 or 5 years of the loan. This will enable you to benefit from the lower rate, but you won't ever have to worry about the risk of a rate adjustment because you will be selling the home before the fixed-rate period ends.
Refinancing can be the right move to improve your financial situation, but be careful. Making the wrong move can put you much worse off. Smart and simple choices will go a long way toward keeping you financially secure.
It's better to follow the 2% Rule which suggests that you can enjoy the benefits of a home refinance if your mortgage refinance rate is 2% lower than that on your current loan. The interest savings will help you recoup the costs you've paid for the new loan provided you stay in the property for a certain period of time (break-even period). However, there are no-cost as well as low-cost refinance loans wherein the costs are included into the loan. But you can expect comparatively higher rates on such loans. Moreover, these loans are limited when the market is in a credit crunch.