The Pharisee (in red) boastfully looks up to heaven. The tax collector in true repentance won't even look up to heaven. The scene is much different when they leave the Temple. The tax collector now looks up to heaven and the Pharisee walks away downcast.
The tax collector goes home justified before God. This was so not because of the tax collector's goodness. He wasn't good before God and he knew it. He was justified by God out of His great mercy.
The tax collector's humble repentance was willing to receive grace from God. The pride of the Pharisee could not receive it.