Energy efficiency (EE) is a key figure of merit for designing the next generation of communication systems. Meanwhile, relay-based cooperative communication, through machine-to-machine and other related technologies, is also playing an important part in the development of these systems. This paper designs an energy efficient precoding method for optimizing the EE/energy consumption of two-way multi-input multi-output (MIMO)-amplify-and-forward (AF) relay systems by using pseudo-convexity analysis to design EE-optimal precoding matrices. More precisely, we derive an EE-optimal source precoding matrix in closed-form, design a numerical approach for obtaining an optimal relay precoding matrix, prove the optimality of these matrices, when treated separately, and provide low-complexity bespoke algorithms to generate them. These matrices are then jointly optimized through an alternating optimization process that is proved to be systematically convergent. Performance evaluation indicates that our method can be globally optimal in some scenarios and that it is significantly more energy efficient (i.e., up to 60% more energy efficient) than existing EE-based one-way or two-way MIMO-AF precoding methods.