IF does not work in code

Can anyone help? :confused: