If it's played by the same rules, why does one innings (both sqauds) of ODI take a half day whereas one innings of a test take 2 days? Or does it have to do with the amount of overs?
It's totally different strategy for one-day versus tests, and the rules aren't all exactly identical. In one-day matches, there are limits on maximum number of overs a bowler can bowl. Also, there are restrictions on placement of fielders in one-day. During the later stages of one-day matches, fielders must be spread out more to encourage faster run rate. In test matches, there are no such restrictions and the captian can choose whatever fielder placement he would like.