Seeing Prophet Muhammad in a Dream
Question

Once I saw Muhammad (peace and blessings of Allah be upon him) in my dream. But he was like a young guy or young children. Of course his (peace and blessings of Allah be upon him) appearance did not match with what I read about him (peace and blessings of Allah be upon him).
But, I think (Hope) that it was HE (peace and blessings of Allah be upon him). Because I asked him (peace and blessings of Allah be upon him):' Are you indeed (really) Muhammad (peace and blessings of Allah be upon him)?' He (peace and blessings of Allah be upon him) said: 'YES'. Who, except him (peace and blessings of Allah be upon him) himself, can say that?
The second time, there was a voice like in old times, when somebody is coming to the castle of the king. This voice said: 'Muhammad (peace and blessings of Allah be upon him)!' And very handsome men, between the ages of 40-45 came and just showed me a piece of paper. And that was it.
How can I know that in both dreams it was he (peace and blessings of Allah be upon him)?
Praise be to Allah.Is it is possible to see Prophet Muhammad in a dream?
It should be noted that it is possible for a person to see the Prophet (peace and blessings of Allah be upon him) in a dream , and that the Shaitan cannot appear in the image of the Prophet (peace and blessings of Allah be upon him), but he could appear in another form and claim that he is the Prophet (peace and blessings of Allah be upon him). 
Abu Hurayrah said: I heard the Prophet (peace and blessings of Allah be upon him) say: “Whoever sees me in a dream will see me when he is awake; the Shaitan cannot take my shape.” (Narrated by al-Bukhari, 6592; Muslim, 2266) 
According to a report narrated by Ahmad (3400): The Shaitan cannot resemble me.” 
Al-Hafiz Ibn Hajar said: 
‘We have narrated it with a complete isnad from Isma’il ibn Ishaq al-Qadi from Sulayman ibn Harb – who was one of the shaykhs of al-Bukhari – from Hammad ibn Zayd from Ayyub who said: If a man told Muhammad (meaning Ibn Sirin) that he had seen the Prophet (peace and blessings of Allah be upon him) [in a dream], he would say, “Describe to me the one whom you saw.” If he gave a description that he did not recognize, he would say, “You did not see him.” Its isnad is sound, and I have found another report which corroborates it. Al-Hakim narrated via ‘Asim ibn Kulayb (who said), my father told me: I said to Ibn ‘Abbas, “I saw the Prophet (peace and blessings of Allah be upon him) in a dream.” He said, “Describe him to me.” He said, “I mentioned al-Hasan ibn ‘Ali and said that he looked like him.” He said, “You did indeed see him.” Its isnad is good.” (Fath al-Bari, 12/383, 384)
Does Prophet Muhammad appear in all forms in dreams?
With regard to those who say that the Prophet (peace and blessings of Allah be upon him) may appear in all forms [in dreams], quoting as evidence the report narrated by Ibn Abi ‘Asim from Abu Hurayrah, that the Messenger of Allah (peace and blessings of Allah be upon him) said: “Whoever sees me in a dream has indeed seen me, for I may be shown in all forms” – this hadith is da’if (weak). 
Al-Hafiz Ibn Hajar said: 
“Its isnad includes Salih the freed slave of al-Tawamah, who is weak who became confused (in old age), and this is a report from someone who heard it after he became confused.” (Fath al-Bari, 12/384) 
Is it possible to see Prophet Muhammad in a dream as a young man or a child?
What is mentioned in the question about having seen the Prophet (peace and blessings of Allah be upon him) as a young man or a child is possible , but it is also subject to the conditions mentioned above, which is that he should look as he would have looked at that age. 
Al-Hafiz Ibn Hajar said:  
“The phrase “[the Shaitan] cannot” indicates that although Allah gave him the ability to appear in any form he wants, He does not allow him to appear in the form of the Prophet (peace and blessings of Allah be upon him). This was the opinion of a group who said concerning the hadith: What this refers to is when a person sees him as he really looked. 
Some of them restricted it even further and said: He must see him as he looked when he died, so he must even take into consideration the number of his white hairs which was no more than twenty. 
The correct view is that he may be seen at any age or in any condition, so long as he appears as he really looked at any time, whether as a youth, in the prime of manhood, in old age or any other time of his life.” (Fath al-Bari, 12/386) 
Can the Shaitan come to a person in his sleep and claim to be the Prophet ?
Once this is understood, it is possible for the Shaitan to come to a person in his sleep and claim to be the Prophet (peace and blessings of Allah be upon him), if he comes in a form other than the way in which Allah formed him at all stages of his life. 
The fact that there was a voice like in old times, or very handsome men, or someone who said “Muhammad (peace and blessings of Allah be upon him)” has nothing to do with seeing the Prophet (peace and blessings of Allah be upon him) in his true form. 
And Allah knows best.