copy a directory from a remote host to a local archive

ssh [username@]<hostname | ip adres> "tar czvf - [path/directory]" > archive.tar.gz

example:

ssh user@host.com “tar czvf - /home” > home.tar.gz