

It’s how parliamentary democracy works. The Prime Minister (PM) is elected by Members of Parliament (MPs) who are, in turn, directly elected by canadians. Typically, the Prime Minister is the leader of the largest party, but not always since a coalition of smaller parties could theoretically band together to elect their choice for PM. Carney was just elected leader of The Liberal Party of Canada, the largest party currently sitting in the Canadian lower house, by members of said party.
Our head of state and commander in chief is King Charles III, whose power is severely limited by constitutional and conventional traditions. Typically, in a parliamentary system, the head of state is merely a figurehead with no ability to influence policy directly.
Our Cabinet, unlike in the American Presidential system where cabinet members are unelected and appointed by the executive, are by convention chosen by the PM from amongst the directly elected MPs.
The PM can be forced to resign, alongside their Cabinet of Ministers, when a majority of MPs support a ‘motion/vote of no confidence.’ An election can be called at any time, with the maximum period between elections being 4 years.
This system of governance is shared with most Parliamentary and Semi-Presidential democracies with some minor differences.
It is definitely atypical for the PM not to be a sitting MP, but it is within the confines of the constitution. The PM only needs to be elected by and then maintain the confidence of parliament.
It’s almost certain that he will call an election immediately, however. A non sitting PM won’t maintain parliamentary confidence for long.
Or a Liberal MP in a safe seat will resign and Carney will stand in the subsequent by-election.