I have a username with spaces (Name and surname). Yesterday another user told me that he wanted to mention my name but the mention referred only to the first name, leading to a not existing user.
How can he mention a username with spaces in it?
he can't - it has been discussed numerous time in past discussions.
see search box. question has been answered multiple times
change the username to an underscore instead of space or delete space.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.