The second sentence is ungrammatical. "his running" is a noun phrase and does not fit in that place in the sentence. You may be thinking of "When he was running".
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.