let's go step by step.
First we need the sample space.
So there are 10+2 =12 people in the line. They can arrange themselves in 12! ie 479001600 ways.
Now we need to see the favourable cases where there are 3 people between X and Y. So the 3 people along with X and Y can be considered as a single unit say Z.
Now there is Z(X and Y and 3 other ie total 5 people) and 12–5=7 other people.
So there are 7 people and Z ie total 8 objects which can arrange themselves in 8! ways. Now for each such Z the 3 people in between can be chosen and arranged with themselves from 10 people in 10P3 ie 720 ways.
So the favourable cases size is 8!*720=29030400 ways
And X and Y also can interchange there position so we need to multiply by 2. So 29030400*2
So required probability=(29030400*2)/479001600=4/33