Question: There are 10 prisoners and 20 guards in a queue. There are 2 guards asigned to every prisoner. There is 1 guard directly behind every prisoner in a queue and another guard somewhere behind them.
Attempt: well i first thought that i would get solution like this 
$$
10\cdot 2\cdot 28\cdot 9\cdot 2\cdot 25...1\cdot 2 \cdot 1=\\ 10!2^{10}\cdot\prod\_{i=1}^{10}(31-3i)
$$
Or i first pick a first prisoner in 10 ways and one of his guards in 2 ways then i pick a spot for his other guard in 28 ways...problem is there aren't 28 spots for him, he cant stand on the 4th spot because 3rd spot is reserved for a prisoner

Answer: 
From the statement of your problem, I am assuming that the guards are already assigned to the prisoners (before the counting process starts).

There are $10!$ different orderings of the prisoners. Then for each prisoner one of the prisoner's two guards is chosen to stand directly behind that prisoner ($2^{10}$ ways to do this). 

Let's now label the prisoners $P\_1,...P\_{10}$ according to their order in the line, and the directly behind guards $G\_1,...,G\_{10}$, and the remaining guards $g\_1,...,g\_{10}$. Here specifically, the guards $G\_i$ and $g\_i$ are the guards of prisoner $P\_i$.

So we need to place the $g\_i$ guards into the line. We'll start with $g\_{10}$ and work backwards. So $g\_{10}$ has only one slot available: behind $G\_{10}$. Next $g\_9$ has three slots available: immediately behind $G\_9$ or immediately behind $G\_{10}$ or immediately behind $g\_{10}$. Similarly $g\_8$ will have $5$ possible spots, and so on.

This gives a total number of arrangements of $10!\cdot 2^{10}\cdot 1\cdot 3\cdot 5\cdot...\cdot 19$.
Suppose you have $2$ prisoners $X,Y$ and $4$ guards $A,B,C,D$. Does the particular order $XAYBCD$ count once or twice? You could have $\{A,C\}$ guarding $X$ and $\{B,D\}$ guarding $Y$ or have $\{A,D\}$ guarding $X$ and $\{B,C\}$ guarding $Y$.

If your answer is to count the particular order $XAYBCD$ once then the number of orders of prisoners and guards might be: 

* there are the Catalan number $C\_{10} = {20 \choose 10} / 11 = 16796$ ways of positioning the indirect guards
* and $10!$ ways of ordering the prisoners,
* and $20!$ ways of ordering the guards,
* making the answer $\frac{ 20!\,20!}{10! \, 11} = 148283734702930287132672000000$ possible orderings

With $1$ prisoners and $2$ guards, this would be $\frac{ 2!\,2!}{1! \, 2} = 2$ which is obviously correct; with $2$ prisoners and $4$ guards, this would be $\frac{ 4!\,4!}{2! \, 3} = 96$ of which there are $48$ of the $XAYBCD$ type and $48$ of the $XABYCD$ type