Translation:Do not speak to him while he is driving.
I tried "Sprechen nicht mit ihm, während er fährt" and it was accepted.
It shouldn't have been.
What kind of exercise was this?
May I know what is the difference between "Sprechen Sie" and without "Sie"?
For a command addressed to Sie, only sprechen Sie! is correct, not sprechen!
(There is an impersonal command that does not use Sie, but that uses different grammar -- that would be Nicht mit ihm sprechen, während er fährt. That kind of construction is most often found on signs that do not address any particular person.)
If you are speaking to du (one person whom you know well), then you say Sprich!
If you are speaking to ihr (several people whom you know well), then you say Sprecht!
If you are speaking to Sie (one or more people whom you do not know well), then you say Sprechen Sie!
The command forms for du and ihr are proper imperatives, and (like English commands) do not mention the subject. (We say "Speak!" or "Don't speak!" rather than "Speak you!" or "You speak!".)
Sie acts grammatically like a third-person pronoun, so its command form is technically a subjunctive, not an imperative, and has to include the pronoun.
Why is the verb fahrt not before wahrend ie" ...,wahrend fahrt er" Thank you
Please pay attention to the spelling -- ihr fahrt with a but er fährt with ä. And wahrend means "maintaining" but here you have während "during, while".
If you cannot make the letter ä, then write ae, as in waehrend er faehrt.
während is a subordinating conjunction -- it starts a subordinate clause, and those have the conjugated verb at the end.