In order to make sure you have the right length of chain on your bike, place the new chain on the largest chainring as well as the largest sprocket. You don’t have to thread it through the derailleur just yet.
Once you’ve got that done, pull the ends together. See where they could approximately connect. Then take the longer end and count off two pinholes more. Make sure they are able to mate with the other end and normally, that means that the part that you cut with the chain tool must end with INNER PLATES. If the point of two more pinholes ends in an outer link, round up and cut at the next inner link. DON’T EVER ROUND DOWN!
Thread the chain through the derailleurs and then with your chain tool or with your master link, connect the two ends. With either case, you will probably need to pull and bend a tad the link as it will probably be a bit stiff.