Is there any grammar rule says that the two subjects with would rather should be the same or different to use whether ( past simple or infinitive)?
She would rather he didn't come.
She would rather (she) not come.
Hi, Mr. Bashir—If both tokens of "she" in your second example refer to the same person, the second one should not be used:
(2a) She would rather not come.
When there is a subject between "rather" and the following verb, that subject is actually the subject of a "that"-clause:
(1a) She would rather that he didn't come.
When the subject of the verb following "rather" is not expressed and is the same as the subject of "would," there is no "that"-clause:
(2b) *She would ratherthat not come.
Instead, in "She would rather not come" and "She would rather come," the main verb is the complement of the modal "would," "rather (not)" coming in between.
It should be no mystery, then, that in "would rather (not) [verb]," the verb is in the base form, since modals are always followed by the base form of a verb.
Where there is a "that"-clause, as in "She would rather [that] he didn't come," it is the "that"-clause that is the complement of "would," not the verb.
That the verb within the "that"-clause is commonly in the past tense can be accounted for as a type of backshift, since "would" is a past form.
Consider that, in historical usage, "would that . . ." was used, and that the past tense was used in the "that"-clause:
"I would that ye all spake with tongues, but rather that ye prophesied: for greater is he that prophesieth than he that speaketh with tongues . . ."
- 1 Corinthians 14:5, King James Version (1611)
That quote is a splendid specimen of historical usage, insofar as you can see the "would rather that" structure coordinated with the "would that" structure.
Just for your awareness, it is fairly common, in native-speaker usage, for the present subjunctive to be used as an alternative to the past in the "that"-clause:
(1b) She would rather that he not come.
I am not saying that you should answer that way on your tests in Egypt, just that you should be aware that that is an acceptable alternative to most speakers.