You will NOT need to clear customs at JFK if arriving on a domestic flight and then departing on an international flight. When you arrive at T8 follow signs to AirTrain and take train on track 2 to T4. Two hours should be enough time to make your connection.
You will NOT need to clear