In n-type semiconductor pentavalent impurity is added. Each pentavalent impurity donates a free electron. So the Fermi-level of n -type semiconductor will go upward.
& In p-type semiconductor trivalent impurity is added. Each trivalent impurity creates a hole in the valence band. So the Fermi-level of p-type semiconductor will go downward.