He is going to stay until a new leader is chosen by the Liberal Party of Canada.
Currently, this is “Working as Intended” in Canada’s political system.
It's just that in Canada, that continuity plan is reserved for unfortunate deaths. When a PM wants to resign, they basically do what Trudeau did; they announce their party will do a leadership race while they stay on as PM.
It’d cause a crisis with the monarchy but they’re not legally bound to appoint the deputy. Like you said it only applies to special circumstances, I was just addressing the legal mechanism by which it happens (as the OP talked about a PM dropping dead).