Hello and welcome to the site. Thank you for your question.
The conditions that have to be met for private residence relief are
the dwelling house has been your only or main residence throughtout your period of ownership and that you have not been absent other than for an allowed period of absence or because you have been living in job-related accommodation, during your period of ownership.
It would appear from information provided that the house in question was fully let for most of the time you have owned it. You would certainly be able to claim private residence relief for the period it was your only and main residence. You say you have owned it for over 20 years... was it ever your main residence other than spells of few months a year.
The fact you moved into this property for 5 months whilst the house you normally lived in was being holiday let would not qualify you for private residence relief unless it has been your main residence in the past, I'm afraid.
More information on private residence relief can be found here
There are examples of private residence relief on the helpsheet.
I hope this is helpful and answers your question.
If you have any other questions, please ask me before you rate my service – I’ll be happy to respond.