There is no hard and fast rule. If there was, people could cleverly arrange to make money just often enough to stay on the "ok" side. It's a judgement call by the CRA and it probably starts with an audit, and depends on the reasons for the loss.
Simple example: your business is selling your time at X an hour and you have expenses that you will cover if you sell Y hours a year, where Y is a lot less than the 2000 hours we have to sell each year. Maybe 300. And you had a big contract but it fell through and though you tried and tried you couldn't get another contract. This will probably be considered a reasonable loss.
Another example: your business is selling art or antiques, most of which are kept in your house where you can look at them every day and enjoy them. Your expenses include lots of flights to places where these art or antiques come from, or perhaps are inspired by, along with hotel and restaurant costs, and you would need to sell your entire inventory every year just to cover these expenses, yet you only sell one or two pieces a year (or none) and there's no indication that you're particularly trying to sell more than that. This will probably be considered an unreasonable loss, and if the situation persists for many years in a row, the expenses may end up being disallowed.
Side businesses often lose money at first. In fact, once they stop losing money they stop being side businesses. If you have spin up costs like buying hardware, developing software, or acquiring inventory, and you can show how long those extra costs can be expected to last, your expenses are less likely to be disallowed. That's the issue, not how many years in a row the loss occurred. This archived CRA document http://www.cra-arc.gc.ca/E/pub/tp/it364/it364-e.html gives examples of startup expenses that were allowed in years that didn't have revenue, never mind profit.