I had not [hadn’t] visited the Louvre before so I didn’t know where the Mona Lisa was.
How did you know where the Mona Lisa was? Had you visited the Louvre before?
Had they studied English before they went to London?
I had [I’d] visited the Louvre before, so I knew where the Mona Lisa was.
They had not [hadn’t] studied English before they went to London.
They had [They’d] studied English before they went to London.