I am not clearly understanding this question. What exactly does taking 3 at a time mean? I thought the answer would be 8P3 × 5P3 × 2!. You first select 3 boxes out of 8 and those can be arranged 3! ways, then select 3 boxes out of 5 and those can be arranged 3! ways, and finally, the last 2 boxes can be arranged 2! ways. However, this is wrong.
The real answer is 336.
Usually I use the following formula: You have $8$ digits, and how many $3$ digit numbers you can create, then $8\times(8-1)\times(8-2)=336$.
The idea is that in your first choice you have 8 boxes from which you can choose. Then after you take out one, you will be left with 7 to choose from, and so on.