Legalism is a theory of autocratic, centralized rule and harsh penalties. Confucianism is an ethic of moral uprightness, social order, and filial responsibility.
Legalism emphasizes the proscribing of laws in order to ensure public order, whereas Confucianism is more concerned with instilling morality.