The scene between Malcolm and Macduff in Act IV sc iii appears very confusing at first glance until we realize Malcolm is actually testing Macduff’s loyalty to Scotland. Malcolm tells Macduff that he will be a far worse tyrant than Macbeth will:
“It is myself I mean: in whom I know
All the particulars of vice so grafted
That, when they shall be open'd, black Macbeth
Will seem as pure as snow, and the poor state
Esteem him as a lamb, being compared
With my confineless harms.”
At first Macduff does not believe him, since Macbeth is such an evil, treacherous leader. No one else could possibly be worse. However, Malcolm claims he is extremely lustful, greedy, and unjust. He would deliberately abuse the powers that come with being king for his own pleasure and gain, completely opposing any action that would be for the good of Scotland. Macduff finally believes him and rebukes him for being such a vile son when King Duncan was such a noble father. He agrees that Malcolm should not govern Scotland, and he weeps because the country he loves has no hope of escaping oppressive tyranny.
At this point Malcolm confesses that everything he said about himself was a lie. He wanted to see how Macduff would react. If Macduff were fine with Malcolm becoming king even though he was as bad (or worse) for Scotland than Macbeth, Malcolm would know that Macduff did not truly love Scotland. Macduff would just be trying to gain advantage by aligning himself with a new tyrant, and therefore could not be trusted.
Macduff passes the test, showing that his love and loyalty are to his country above himself. When Malcolm sees this, he tells Macduff the truth and explains his current plans to dethrone Macbeth. The two become allies.