Let $B_0$ and $G_0$ be the boy and girl who must not sit next to each other. Number the seats $1$ through $8$ from left to right. Suppose that $B_0$ sits in seat $1$. Then there are $3$ girls $-$ all of them except $G_0$ $-$ who can sit in seat $2$. After that the other $3$ boys can fill seats $3,5$, and $7$ in any order, and the other $3$ girls can fill seats $4,6$, and $8$ in any order, for a total of $3\cdot 3!\cdot 3! = 108$ ways to fill the seats with $B_0$ in seat $1$. An exactly similar calculation shows that there are also $108$ ways to fill the seats with $B_0$ in seat $8$.
If $B_0$ chooses to sit in one of the six seats in the middle, matters are a little different, because there are now two seats in which $G_0$ cannot sit. Note, though, that as soon as $B_0$ takes his seat, we know which $4$ seats must be taken by the girls, and we know which $3$ seats must be taken by the other $3$ boys. Those $3$ boys can sit as they please among those $3$ seats, so that’s $3!=6$ choices. $G_0$ has a choice of the $2$ ‘girl’ seats not adjacent to $B_0$: that’s another $2$ choices. Finally, the remaining $3$ girls can sit as they please among the remaining $3$ ‘girl’ seats, for another $3!=6$ choices. The grand total is then $6\cdot 2\cdot 6=72$ ways in which they can be seated once $B_0$ chooses a particular middle seat. Since there are $6$ middle seats, that comes to a total of $6\cdot 72 = 432$ ways.
Finally, combine the two cases: we have altogether $2\cdot 108 + 6\cdot 72 = 216+432=648$ ways to seat the $8$ of them.
I think it is explained in your OP. We do the same thing with a bit more detail.
Since we have already counted the number of "bad" positions with all the boys together, it remains to count the number of bad positions in which the boys are not all together, but some boy is not next to a girl.
There must be two boys together, and they must be at the left end or the right end ($2$ choices). Take such a choice, say left end. Then the remaining boy can be in any one of $3$ places, namely positions $4$, $5$, or $6$. That gives us $(2)(3)$ ways of choosing the seats the boys will occupy. For each of these $(2)(3)$ choices, there are $3!$ ways of permuting the boys among the chosen seats, and for every such choice there are $3!$ ways of permuting the girls, for a total of $(2)(3)(3!)(3!)$.
Another way: Counting all possible arrangements and subtracting the "bad" ones is often good strategy. But let us count directly.
Our condition will be satisfied if either no two boys are together, or exactly two boys are together and they are not in the end seats.
Count first the arrangements in which no two boys are adjacent. Write down $G\quad G\quad G$. This determines $4$ "gaps" into which we can slip the boys, one boy per gap. There are $4$ "gaps" because we are including the end gaps. There are $\binom{4}{3}$ ways of choosing $3$ of these gaps.
Or else we could slip $2$ boys into one of the two center gaps ($2$ choices), and then slip the remaining boy into one of the $3$ remaining gaps, for a total of $6$ choices.
Thus the places for the boys can be chosen in $10$ ways. For each of these ways, we can arrange the boys is $3!$ ways, and then the girls in $3!$ ways, for a total of $360$.
Best Answer
I believe it should be solved in the following way:
Girls have 12 desks to choose (left or right): $$ ^{12}P_{7} \times 2^{7} $$
No girls alone mean that 7 boys are with them in the 7 desks that already have girls: $$ ^{11}P_{7} $$
The rest of the boys (4) are in the remaing 10 places: $$ ^{10}P_{4} $$
Putting everything together gives: $$ ^{12}P_{7} \times 2^{7} \times ^{11}P_{7} \times ^{10}P_{4} $$
I assumed that the desks are distinguishable, e.g., being in the front left desk is different from being in the middle right desk.