I like to use awk instead of grep wherever possible, especially for weird logic like this.
awk '!/B/ || /A.*B/'
is one way to skin that cat. If you don't care what order A and B are in on the lines containing both, then awk '!/B/ || (/A/ && /B/)'
will work.