The “midterm election” rule is better stated as a rule applying to the midterm of a second term presidency. FDR 1938 (GOP gained 81 H and 6 S), Truman 1950 (GOP gained 28 H, 5 S), Eisenhower 1958 (DEM gained H 49, 13 S), Kennedy/Johnson 1966 (GOP gained H 47, S 3), Nixon 1974 (DEM gained H 49, S 3), Reagan 1986 (DEM H 5, S 8), Clinton 1998 (GOP gained H 5, S 0), Dubya 2006 (DEM gained H 31, S 5).
Good point, of those examples of the President’s party doing well all but 1998 (where GOP lost 5 in the House, broke even in the Senate and lost state leg seats) were first-term midterms.