I want to make a DC motor turn on while an LED is on but make it turn off when a Second LED is on with the click of a button

== is for a compare, = is an assignment.

Why do you want to read the LEDs? The usual approach is to keep a variable that is set when a condition is true and is cleared when another condition is true. Your motor can run based on that variable.