1. This is the way how he did it. (X)

2. This is the way he did it. (O)
3. This is how he did it. (O)

4. Do you know the reason?
5. Do you know why?
-----------------------------
#1 is ungrammatical.
#2 and #3 are grammatical.
Why is #1 ungrammatical?
Was #1 used in old English? Because 'the way' and 'how' have the same meaning, #1 is ungrammatical in modern English, isn't it?
Is #4 or #5 grammatical? Are both the same?

2 and 3 are correct, yes.

4 and 5 are correct, too, yes.

#1 is incorrect because of the redundancy of "the way" and "how" -- you need one or the other of those, but not both.

The reason why sentence #1 is ungrammatical is because there is an unnecessary use of "how" which makes it redundant. In English, "the way" and "how" have similar meanings when used to ask about a method or manner in which something is done. Therefore, using both "the way" and "how" together in a sentence is redundant and considered grammatically incorrect in modern English.

In contrast, sentence #2, "This is the way he did it," and sentence #3, "This is how he did it," both are grammatically correct. Both convey the same meaning of asking about the manner or method someone used to do something. The difference between the two is the choice of words, where "the way" and "how" can be used interchangeably in such contexts.

As for sentences #4 and #5, both are grammatically correct and are used to ask about the reason for something. Both sentences have the same meaning and can be used interchangeably.