Line Follower Code Issues

Im trying to make a 3 sensor line follower so i searched for many codes and tried to do one and simple but i dont know nothing of arduino and i dont know if im doing the statments correctly for the conditons of the if

#define LS 2 // left sensor
#define RS 3 // right sensor
#define MS 4 // middle sensor

#define LM1 4 // left motor
#define LM2 5 // left motor
#define RM1 6 // right motor
#define RM2 7 // right motor
void setup()
{
pinMode(LS, INPUT);
pinMode(RS, INPUT);
pinMode(MS, INPUT);
pinMode(LM1, OUTPUT);
pinMode(LM2, OUTPUT);
pinMode(RM1, OUTPUT);
pinMode(RM2, OUTPUT);
}
void loop()
{
if(digitalRead(LS) && digitalRead(MS) && digitalRead(RS))
{
digitalWrite(LM1, LOW);
digitalWrite(LM2, HIGH);
digitalWrite(RM1, LOW);
digitalWrite(RM2, HIGH);
}

if((digitalRead(LS)) && digitalRead(MS) && !(digitalRead(RS)))
digitalWrite(LM1, LOW);
digitalWrite(LM2, LOW);
digitalWrite(RM1, HIGH);
digitalWrite(RM2, LOW);
}

if(digitalRead(LS) && !(digitalRead(MS))&& digitalRead(RS))
{
digitalWrite(LM1, HIGH);
digitalWrite(LM2, LOW);
digitalWrite(RM1, HIGH);
digitalWrite(RM2, LOW);
}

if(digitalRead(LS) && !(digitalRead(MS)) && !(digitalRead(RS)))
{
digitalWrite(LM1, HIGH);
digitalWrite(LM2, LOW);
digitalWrite(RM1, LOW);
digitalWrite(RM2, LOW);
}
if(!(digitalRead(LS)) && digitalRead(MS) && digitalRead(RS))
{
digitalWrite(LM1, LOW);
digitalWrite(LM2, LOW);
digitalWrite(RM1, HIGH);
digitalWrite(RM2, LOW);
}
if(!(digitalRead(LS)) && !(digitalRead(MS)) && digitalRead(RS))
{
digitalWrite(LM1, LOW);
digitalWrite(LM2, LOW);
digitalWrite(RM1, HIGH);
digitalWrite(RM2, LOW);
}
if(!(digitalRead(LS)) && !(digitalRead(MS)) && !(digitalRead(RS)))
{
digitalWrite(LM1, LOW);
digitalWrite(LM2, LOW);
digitalWrite(RM1, LOW);
digitalWrite(RM2, LOW);
}

}

thats my code sorry if u guys find some crap of programmation still learning

Have you read the forum rules? It is hidden at the top of every section and is called how to use this forum.
Not only does it tell you how to post code correctly it also tells you how to ask a question.

What we need to know is what sensors you are using?

How they are wired up to the Arduino?

What Arduino are you using?

What happens when you run that code?

What do you want to happen?

One of the simplest ways of telling what your code is doing, is to get it to tell you what it is doing, with some debug prints.

And please - remember to use code tags when posting code.