The answer to your first question is that neither sentence is 'more grammatically correct' than the other. Nor is there any difference in meaning.
The difference between the sentences is in the frequency of the respective constructions. The first sentence contains forward reference from the pronoun he to its antecedent Oedipus. The term for this forward reference is cataphora (also known as anticpatory anaphora).
Conversely, the second sentence contains backward reference from the pronoun to its antecedent. This is anaphora, also known as retrospective anaphora. Anaphoric reference is much more common than cataphoric reference.
Quirk et al. in A Comprehensive Grammar of the English Language (p351) state:
Cataphoric reference occurs much less frequently, and under limited
As to the second question about general rules for phrasing such sentences (e.g. the limited conditions), the CGEL notes:
It (cataphoric reference) generally occurs only where the pronoun is
at a lower level of structure than its antecedent.
Dependent or subordinate clauses are an example of what the CGEL means by 'lower level of structure'. This is the case in the present example, where the dependent clause contains the referent pronoun he, and is followed by the main clause with its antecedent Oedipus. It is not permissible, therefore, to use a cataphoric reference if the two clauses are reversed:
?He blinded himself as punishment, when Oedipus learned of the sins he
As the CGEL points out, he and Oedipus "must be understood to refer to two different people."
The difference between the two constructions, therefore, is a stylistic one. The CGEL states:
On the whole, cataphoric reference ... is associated with formal
The Wikipedia article on Cataphora claims:
Cataphora across sentences is often used for rhetorical effect. It can
build suspense and provide a description.
There is a good article on Cataphora at About.com with many examples from literature and the media.