The above answer is wrong.
Suppose the 6 people are A,B,C,D,E,F and A and B cannot be together.
There are 6! = 720 ways to arrange the 6 people regardless of
whether A and B are together or not.
From that we subtract the number of ways where the two are together
with A on the left of B. Then that is the number of ways to arrange
these 5 things, 1 pair of people and 4 single people.
AB,C,D,E,F
which is 5!
And we also must subtract the number of ways where the two are
together with B on the left of A. This time the number of ways to
arrange these 5 things, also 1 pair of people and 4 single people.
BA,C,D,E,F
which is also 5!
So the correct answer is 6! - 5! - 5! = 6! - 2*5! = 480 ways.
Edwin