There are two types of content which are illegal to share on torrent.
1. Copyrighted content.
2. DRM protected content.
Both these type of content if shared from torrent, will likely to have piracy case on you. In case of copyrighted content, it comes under piracy law. And you're not allowed to share or download such content. This is the most generic type of restriction that is being applied around the world. So the punishment for sharing such content depends on the type of content being shared and the legal and financial hassle for the content creator.
In case of DRM content, the content holds the ID of the distributor or the customer who purchased the content. And in such case the person who shared and the person who downloaded, both get into clause for the punishment. Often DRM laws are applied across the border too. And the punishment can be severe. E.g. kim dot com of the megaupload got very harsh punishment and was forced under treaty rights from new zealand to US. So in between the copyright distribution case and DRM distribution case, the DRM being the most severe type of the law and often keeps the pirates away.
If you are downloading any movie or legal content without paying for it, then stop. It is piracy and it's upto you to deal with that issue if you choose to do so.
Torrent technology works on space sharing basis. So you don't upload any content to torrent. You just create a file that links to the desktop folders with links to specific files and torrent file if used by other downloads the file accordingly. This way you are not uploading the content from torrent program. It can be used to share office work or it can be used to content owned by you or the one you're allowed to distribute.
However there is one catch to the torrent use. Free software and Open source communities are allowed to use it.
Open source communities such as Linux, Git, UNIX and few other companies which distribute content under public domain and creative commons make use of torrent. So the content distributed by them using the torrent is completely legal. And there is no legal law that can stop them from using the torrent service. Also not even ISPs can block or ban them for using such technologies.
99% of the Linux OS have their ISO image available through torrent file. And they distribute other packages through the torrent too. So they are not under illegal clause. And they are allowed to share the content with the public in this way.
Public domain content (i.e. content produced 50 years and before) is also allowed to share online by torrent or any means. No copyright applies unless original author has any provision for the same.