The thermocouple needs to be tight in the gas valve then you need to make sure when the pilot flame is burning it is around the thermocouple. If it is not you need to take the pilot assembly apart and clean it. If it still does not work it is possible to have a bad thermocouple and they are cheap but if you change out 2 and it still won't work you probably need a gas valve.