whats wrong ?
What do your debug print statements tell you is happening?
if((sensor[0]==0)&&(sensor[1]==0)&&(sensor[2]==0)&&(sensor[4]==0)&&(sensor[4]==1))
None of these statements reference sensor[ 3 ]. Why not?
You should use bit shifting (or bitWrite()) to make a single value out of the 5 values. Much simpler logic, then.
What kind of sensors are you using to detect the line? Most line following robots do not use digital sensors to detect the line.