I cannot ssh to my server. When I try ssh localhost on the server I get a "connection refused" message. When I try remotely, I get Operation timed out message.
According to the screenshot you are trying to connect to a port 22 however your server is configured to listen to port 22222.
ssh localhost -p 22222. Should work.