In how many ways can you choose two objects (A, B) out of 6? Now, if you denote by _ _ _ _ _ _
the six places in the queue, in how many ways can you choose two places separated only by one
other place? Multiply now this by two (as, apparently, we don't care whether A is behind B or
the other way around) and divide by the total you first calculated...
Added: Simon's comment below made me think (!) about the number of possible placings of a pair of persons in a queue with 6 persons in it: there are 30, not 15, such possibilities, as we can easily check if we place say $\,A\,$ in the first place and then $\,B\,$ can be placed in 5 different places in the queue (yes, it is not the same $ A$ in first place, $B$ in second than the other way around, unless some further info is given). Thus, as answered below, the actual number of possible placings of two persons in the queue indeed is $\,2\times 4=8$, but the total number of placings is 30, thus giving us a probability of $\,\displaystyle{\frac{8}{30}=\frac{4}{15}}\,$ .