This is almost too tedious a counting question to try.

Do you realize that $X=0,1,2,3,4,\text{ or }5~?$

Let the families be denoted by $A,B,C,D,~\&~E~.$

You know the total number of ways to form this line is $15!$.

The number of ways to form this line with all of family $A$ together is $(13!)(3!)$. But that is not the case $X=1$ In fact, in that number there may be any number of other of the families all together.

The number of ways to form this line with each of the five families is together is $(5!)(3!)^5$

The case where there are exactly two families together is very difficult.

Now we can use the inclusion/exclusion counting principle to find the number of ways to haveat least oneof the families all together. The complement of that is the case where $X=0$.

I said that it a nightmare. I hope this helps.