Canada did not leave the British Empire.
The British Empire became the British Commonwealth. Canada was a
member of the Commonwealth from its beginnings, and remains proudly
a member of the Commonwealth today.
The British took Canada from the French during the French and
Indian War. The War was over in 1763. In 1867, The colonies of
Canada (Ontario and Quebec) with New Brunswick and Nova Scotia
became the Dominion of Canada.