Like you said, OP, this is trivial.
Try
course(ai).
course(pl).
course(os).
have(X,Y) :- course(X), course(Y), X \== Y).
That should fix your predicate.
Looking one step ahead though, mathematically phrasing, you are probably looking for the solution to (n C 2) as opposed to (n P 2) which your predicate currently provides—combination instead of permutation, choice of selection as opposed to arrangements of choices of selection. This is what I think.
If this is what you want, I would suggest you try
course(ai).
course(pl).
course(os).
have(X,Y) :- course(X), course(Y), X @< Y).
Which would prevent duplicate reversed results.
@<
means atomically less than. <
is for integers, @<
is for atoms.