The Lord is called the Son of Humanity when the subject is judgment. This we can tell from the following passages:
When the Son of Humanity comes in his glory, then he will sit on the throne of his glory and set the sheep on his right and the goats on the left. (Matthew 25:31, 33)
When the Son of Humanity sits on the throne of his glory, he will judge the twelve tribes of Israel. (Matthew 19:28)
The Son of Humanity is going to come in the glory of his Father, and then he will repay all people according to their deeds. (Matthew 16:27)
Be wakeful at every moment, so that you may be found worthy to stand before the Son of Humanity. (Luke 21:36)
The Son of Humanity is coming at an hour you do not expect. (Matthew 24:44; Luke 12:40)
The Father does not judge anyone; he has given all judgment to the Son, because he is the Son of Humanity. (John 5:22, 27)
The reason the Lord calls himself the Son of Humanity when the subject is judgment is that all judgment is executed according to the divine truth that is in the Word. He himself says in John that this is what judges everyone:
If people hear my words but do not believe, I do not judge them. I have not come to judge the world. The Word that I have spoken will judge them on the last day. (John 12:47, 48)
And in another passage,
The Son of Humanity came not to condemn the world but so that the world would be saved through him. Those who believe in him are not condemned; but those who do not believe have already been condemned because they have not believed in the name of the only-begotten Son of God. (John 3:17, 18)
See Heaven and Hell 545–550 and 574 on the fact that the Lord never condemns anyone to hell or casts anyone into hell. Rather, evil spirits cast themselves in. The name of Jehovah, the Lord, or the Son of God means divine truth and therefore the Word as well, since this is from him and about him and therefore is he himself.
The Lord is called the Son of Humanity when the subject is his Coming, as we can see from the following: the disciples said to Jesus, “What will be the sign of your Coming and of the close of the age?”; and then the Lord foretold the states of the church in succession all the way to the end, saying this about its end: “Then the sign of the Son of Humanity will appear, and they will see the Son of Humanity coming in the clouds of heaven with power and glory” (Matthew 24:3, 30; Mark 13:26; Luke 21:27). The close of the age means the last time of the church; coming in the clouds of heaven with glory means opening the Word and making it clear that it was written about him alone.
I was watching, and behold, the Son of Humanity was coming in the clouds of the heavens! (Daniel 7:13)
Behold, he is coming with clouds, and every eye will see him. (Revelation 1:7)
This too is about the Son of Humanity, as we can see from verse 13 in the same chapter. Again in Revelation:
I looked, and behold, a white cloud, and on the cloud sat someone like the Son of Humanity. (Revelation 14:14)
In his own mind, the Lord understood “the Son of God” and “the Son of Humanity” to mean different things, as we can see from his response to the high priest:
The high priest said to Jesus, “I put you under oath by the living God: tell us whether you are the Christ, the Son of God.” Jesus said to him, “It is as you said. I am. Nevertheless, I say to you, hereafter you will see the Son of Humanity sitting at the right hand of power and coming in the clouds of heaven.” (Matthew 26:63, 64; [Mark 14:61, 62])
Here he first declares that he is the Son of God, and then says that they are going to see the Son of Humanity sitting at the right hand of power and coming in the clouds of heaven. This means that after suffering on the cross he would have access to the divine power to open the Word and establish a church, things that he could not do before because he had not yet overcome the hells and glorified his human nature.
The meaning of coming in the clouds of heaven and coming with glory has been explained in Section 1 of Heaven and Hell.
from The Lord, Sections 25, 26