Let M=man’s current age and S=son’s current age.
Two years ago they were M-2 and S-2 years old. And M-2=5(S-2), M=5S-10+2=5S-8.
6 years from now they will be M+6 and S+6 years old. And M+6=3(S+6), M=3S+18-6=3S+12.
So 5S-8=3S+12, 2S=20, so S, the son’s age now is 10. M=3S+12=30+12=42, the man’s age now.