TCP uses a handshake communication environment to ensure the reliability to the delivery of packets. It does this by having a 'Ack' or acknowledgement number in each packet that's sent. numerically they will increment after each
location it has been to, to understand if the packet has been received.
Host 1 will send a packet to host with 'ACK' 1, host 2 replies with ACK 2 (yes i am ready), host 1 sends data with ACK 3, etc and vice versa to ensure maximum reliability in receipt and data transfer.
I hope i have helped you. Message me if you need more info or more in depth knowledge.