as far as single player goes, i barely played call of duty's single player campaigns. I played 4 more than MW2, but BFBC2 more than both of them.
as for multiplayer
CoD4 > BFBC2 > MW2
If you've played all three games for a considerable amount of time (BFBC2 being my least played game just because i have no one to play it with anymore), you'll easily notice how superior CoD4 is to the other two games. MW2 is the most user friendly of the games, with its cheesey bullshit like noob tubes and commando + care packages, while BFBC2 does have sort of a learning curve even when youve played other FPS before. CoD4 is balanced. The best part about CoD4 is that if you can shoot, you do well. Not "if you can run around and dodge bullets, you can do well" or "if you camp with a heartbeat sensor you can do well". Its pure shoot the other person, with barely any gimmicks. Killstreaks are constant, and aren't overpowered. Noob tubes have a limit of two per spawn, not infinite (and dont have danger close boost). Commando doesn't exist, and neither does lightweight. And the maps in CoD4 are easily superior to MW2. Even the worst maps are a step up from most maps in MW2. The only problem you may run into in CoD4 is completely dominant parties that will corner you and destroy you, game after game. This happens in the other games too, but it is usually much more legitimate in CoD4 and usually less likely to happen. Aircraft in MW2 can completely destroy a game. not only does this not happen in Cod4 because of air balance, but you can only have one aircraft in the air at a time.
As veedrock said, the two (bf/cod) games play differently. But anyone who I've ever spoken to has always preferred CoD4 over MW2. I guess if you start with MW2 you won't understand the hatred for the game, but Infinity Ward/Activision literally destroyed a game series with the sequel. They easily would have satisfied a lot of people by keeping core gameplay, adding a shitload of new maps and adding a few things here and there, but they royally fucked that all up by adding a lot of unnecessary game breaking garbage. I still play MW2, but god is it an annoying game that almost never results in fun, just frustration.