Since the question is asking for distinct handshakes, so, two people cannot shake hand more than once.
Let’s find the general solution. So, assume there are $n$ people in the room.
Method 1:
For maximum number of distinct handshakes, everyone should shake hands with everyone else exactly once. So, the number of handshakes will be same as the number of ways to choose two people from $n$ people.
Hence, the maximum number of handshakes possible is: $nC2 = n(n-1)/2$
For $n=5,$ the answer is $5C2 = 10.$
Method 2:
We can find Recursive Definition for the maximum number of handshakes possible & solve it. Watch the following video:
https://www.youtube.com/watch?v=-wjNOqplZdQ&list=PLIPZ2_p3RNHiEksQl-IEpGBih8QBFvt1a&index=42