For your rival (Barry, the blonde guy) You'll face him before you battle the Elite 4 for the first time. He'll stop you as you head up to the door to the Elite 4 and challenge you.
You can also battle him in the Survival Area once you have access to it (by completing the Sinnoh pokedex). He'll only appear on Saturdays and Sundays, but you can battle him as many times as you want and as you defeat the Elite 4 more times, he'll get stronger and stronger.
For your friend (Dawn or Lucas, whichever character you didn't choose to play as) you'll only fight against them once at the beginning of the game (the standard "test battle" right after you get your starter. Though you'll team up with them a couple more times later in the game