If someone died before he finished writing a book, and he had spent two years on it, which tense should I use:
1. He was writing the/a book for two years before he died.
2. He had been writing the/a book for two years before he died.
I think the second one is correct, but I'm not sure about the first one. Is past continuous tense compatible with a duration for-phrase？ Thanks in advance.