We can explain the ans this way
Selecting a pair for handshake from the 26 people is 26C2
But the women shudn't shake among themselves So subtract 13C2
The men shudn't shake with their wives So subtract 13 (since 13 men r there)
So ans is 26C2 -13 -13C2