I called my friend but he didn’t pick up my phone. I didn’t try to call him immediately because I thought he would be/would have been driving his car.
Two things before I get to your question: First, your friend didn't pick up his phone, not yours. Second, if you're talking about calling him again, you should say "call him again immediately".
Both of your scenarios can use the same words. Neither "would be" nor "would have been" is correct. If you're only guessing that your friend might have been driving, you should say "I thought he might have been driving" or "I thought he could have been driving". The first one is more common.
Also, you don't need to say what he's driving unless there's something special about it.
Here are some improved versions of your sentences:
I called my friend, but he didn't pick up his phone. I didn't try to call him again immediately because I thought he might have been driving. (Scenario 1)
I tried to call you earlier, but you didn't pick up your phone. I didn't try to call again immediately because I thought you might have been driving. (Scenario 2)
And here are some other variants:
I tried calling you earlier, but you didn't pick up your phone. I thought you were probably driving. (More casual; implies more certainty about him driving; uses context to imply that you waited before calling again)
I tried to call earlier, but you didn't answer. I thought you might have been driving, so I waited to call again. (Shorter; uses context to imply who was called)
I tried calling earlier, but you didn't answer. I thought you might have been out driving your new car. (Focuses on what he was driving)