Re IRS rule on non-qualified use of principal residence, is this rule only applicable if you have lived in your principal residence 2 years of last 5 yrs ?

So, there is an equation for computing gain allocable to non qualified use. It takes

Total Period of Non Qualified Use / Total Ownership Period X Gain on Sale of Property.

If we have only rented the home for the last 5 years, does this calculation not come into play ?