Ab initio time-dependent method to study the hydrogen molecule exposed to intense ultrashort laser pulses