Jerry had been studying in the library before he came to the class.
В данном предложении используется Past Perfect Continuous, чтобы подчеркнуть, что действие продолжалось до определенного момента в прошлом.
Ответ: Jerry had been studying in the library before he came to the class.