It's - this is short for 'It is' or 'It has'. It cannot be used for anything else. If 'it's' cannot be replaced by 'it is' or 'it has' then it is incorrect. They call it the 100% rule.
E. g. It's been raining for a week (this can also be written as - it has been raining for a week)
Its - this is like using his or her, only that his is masculine, her is feminine, 'its' is used for neutral purpose.
E. g. The company has its own views in this matter.
It's a pretty simple rule, isn't it?
Doubts on this article