Microcanonical ensemble only deals with isolated systems, but a canonical ensemble deals will closed (energy exchange can happen).
A canonical ensemble is a collection of replicas of a system all having fixed number of particles (N), volume (V), and temperature (T).
Microcanonical ensemble has constant NVE. Grand canonical ensemble μVT, where μ is the chemical potential of the particle.

Ωi(E)=ΩR(E−Ei)Ω(E)=∑iΩi(E)=∑iΩi(E−Ei)

Boltzmann definition of entropy:

SR=kBln⁡ΩR(E−Ei)≈kBln⁡ΩR(E)−∂∂E(kBln⁡ΩR(E))Ei

where in the last step I used Taylor expansion. We know that 1T=∂S∂E

=kBln⁡ΩR(E)−EiT

Hence,

ΩR(E−Ei)=ΩR(E)e−Ei/kBT

Total number of microstates is the sum over i:

Ω(E)=ΩR(E)∑ie−Ei/kBT⇒pi∝e−Ei/kBT$$$$⇒pi=e−Ei/kBT∑je−Ej/kBT=e−Ei/kBTZ$$where$Z$iscalledthepartitionfunction:$Z=∑je−Ej/kBT$