3841
===============
Step 1
According to hint 4, none of 6, 5, 0, 7 is correct. Exclude all those numbers.
Step 2
Hint 3 - one number is correct. It is not 2 as it has different places. Exclude 2 and first correct number is 1 in the last place.
The code looks like ***1.
Step 3
Hint 5 - two correct numbers. We have two numbers left, they are 8 and 4.
Step 4
Hint 1 - one number is correct, it is 8. Exclude 9. Number 8 is in the wrong place. It goes to second place as can't be first or third.
The code looks like *8*1.
Step 5
Hint 2 - number 3 left and it is in the wrong place, hence it goes to first place.
The code looks like 38*1.
Step 6
One number left, it is 4 and it goes to the only place left.
So the code is 3841.