1. "He looks pale," she said.

2. "He looks pale," said she.
3. "He looks pale," said the girl.
4. "He looks pale," the girl said.
-----------------
Which ones are grammatical? Do you have any rule regarding that?

All are correct, but #2 would probably be used mostly in some kind of literature. It's not the everyday way to phrase this.

The others are fine.

Option 3 is the Best Answer according to me. Trust me, I am a School Topper in Emirates English Speaking School, Dubai, UAE. Even though others are grammatical enough, most teachers have Option 3 in mind.

All four versions of the sentence are grammatical, but the choice depends on the writing style and personal preference.

In terms of conventional syntax, the most common and accepted order for attributing speech is: quotation marks, dialogue, comma, and then the attribution. In this case, the first and fourth options ("He looks pale," she said. / "He looks pale," the girl said.) adhere to this conventional order.

However, the second and third options ("He looks pale," said she. / "He looks pale," said the girl.) deviate from the conventional order. Although less common, these alternative word orders are still grammatically correct and can be used for stylistic purposes. They can help create a more formal or poetic tone, or be used in specific contexts where emphasis is desired on the speaker.

In conclusion, while options one and four are the most commonly used in everyday writing and dialogue attribution, options two and three are also grammatically correct and can be used for stylistic variation. The choice ultimately depends on the writer's intentions and the overall tone of the piece.