RCF 793, TCP states

This is the tcp state machines which a normal TCP stack must
implement. A web server will e.g wait in state LISTEN. When it
receives a SYN then it will send a SYN,ACK packet an go to
state SYN RCVD. There it will wait until it has received the
ACK for the SYN,ACK and then the connection is established
(state ESTAB).

When the web server has sent all the data for the requested
page it sends a FIN in order to move to state towards CLOSING.