You need proof beyond reasonable doubt. The court will get expert witnesses to figure out who strong the evidence is.
First, someone will tell the court that if your home IP address has been used, how strong evidence it is that your computer or phone was used. And then if your computer or phone was used for a crime, it depends on the situation how much evidence it is that you used that computer or phone for the crime.
If the expert witness says there is no reasonable doubt that your computer was used for the crime. and the situation is such that there is no reasonable doubt that only you could have used the computer, then the IP address may be enough. If you share a flat with three other people, it's very unlikely enough evidence.
PS. To the comments: Yes, some hacker might be able to spoof your IP address. That’s where you’d need an expert witness who explains how much the IP address proves that your computer was used. But spoofed addresses can often be identified if one looks more closely, and it can be possible to prove that no spoofing happened in your case.
And yes, some hacker might be able to take control of your computer. That’s where someone has to find out how much your computer being used for a crime is evidence for you committing the crime. Such hacking will leave traces, and forensic examination can prove that your computer was not hacked.