45(2) applies to any change in use where the property was used for personal use and then changed its use to an income producing use.
You can own 10 properties that would qualify as a principal residence in a year, but can only designate one per year. This is a common scenario when people own a house in the city and a cottage in the country. You will be paying taxes on the capital gains for one of those properties.
There is no specification that 45(2) only applies if you rent a place after moving from your principal residence and turned it into a rental. Remember, a house is only a principal residence if you designate it as such.
By electing under 45(2), now the the taxpayer has the choice to designate either the rental property (for 4 years after the change in use) or the house he actually lives in as his principal residence, but you can only designate one property per year.