From what I understand you can have one regular companion at a time
You can add Dog meat as a second companion if you have C-3 Attack Dog
You can add a extra named companion as a second companion if you have C-5 Local Leader Rank 3
You can add a extra non-named human, non-feral ghoul, or super mutant as a second companion if you have C-10 Intimidation
You can add a add a robot as a second companion if you have I-8 Robotics Expert
You can have a total of three companions at one time.
So you might have Preston Garvey as you main companion
Piper as your second companion with C-5 Local Leader Rank 3
Dog meat as your third companion with C-3 Attack Dog