No clear rules, but the guidelines you state are correct. For very formal writing, use 'he or she' unless you have to use it more than twice or thrice. g.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.