Canada has a parliamentary system where the leader of the party with the most votes becomes prime Minister. So Trudeau can step down as leader of his party while remaining Prime Minister.
In this case he intends to stay on until his party selects a new Prime Minister