Haskell, 33 bytes
nub.((\\)<*>nub)
import Data.List
Try it online! Port of my Husk answer.
The point-free version given above is equivalent to f x=nub$x\\nub x
which is one byte longer.
Haskell, 50 bytes
([]#)
a#(x:r)=([x|any(==x)r,all(/=x)a]++a)#r
a#_=a
Try it online! Alternative without imports.