What moves the answer
Price growth: the biggest swing factor. Try 0% to see buying without appreciation.
How long you stay: upfront costs weigh heavily on short stays.
The rent for an equivalent home, and how fast it rises.
Selling costs (agent fees, RPGT if sold within 5 years) are not included, which flatters buying over short periods.