A CFI is a certified flight instructor. They are allowed to train students to pilot planes, but only in aircrafts with singular engines. The caveat to this, is that if you take your checkride in a twin engine plane, then you can instruct in those and only those aircraft.
The regulations surrounding CFIs and Basic Med are complex. In simple terms, provided you are acting as a PIC (pilot in command) in an aircraft covered under Basic Med, you can use it while flying.
The regulations surrounding Basic Med aircraft are as follows. The aircraft must be authorized under federal law to carry a maximum of 6 people - i.e. 5 passengers and the CFI. The certified takeoff weight must not exceed 6,000 pounds, and the flight cannot be used for hire or compensation.
The aircraft must also operate under VFR (visual flight rules) or IFR (instrument flight rules) within the United States. The aircraft must not leave the United States when being flown under Basic Med. The aircraft cannot exceed heights of 18,000 feet and must travel at a maximum speed of 250 knots.