Active rehabilitation can use electro-encephalogram (EEG) signals to identify the patient's left and right leg movement intentions for rehabilitation training, which helps stroke patients recover better and faster. However, the lower limb rehabilitation robot based on EEG has low recognition accuracy so far. A classification method based on EEG signals of motor imagery is proposed to enable patients to accurately control their left and right legs. Firstly, aiming at the unstable characteristics of EEG signals, an experimental protocol of motor imagery was constructed based on multijoint trajectory planning motion of left and right legs. The signals with time-frequency analysis and event-related desynchrony/synchronization (ERD/S) analysis have proved the reliability and validity of the collected EEG signals. Then, the EEG signals generated by the protocol were preprocessed and common space pattern (CSP) was used to extract their features. Support vector machine (SVM) and linear discriminant analysis (LDA) are adapted and their accuracy of classification results are compared. Finally, on the basis of the proposed classifier with excellent performance, the classifier is used in the active control strategy of the lower limb rehabilitation robot, and the average accuracy of the left leg and right leg controlled by two healthy volunteers was 95.7%, 97.3%, 94.9%, and 94.6%, respectively, by using the ten-fold cross test. This research provides a good theoretical basis for the realization and application of brain-computer interfaces in rehabilitation training.