Primary groups and in-groups are similar ideas. Secondary groups and out-groups are very different ideas. This is the major difference between these two sets of ideas.
Primary groups and secondary groups are both groups to which we belong. In other words, I identify both with my primary groups and with my secondary groups. A primary group is one to which I feel a very close attachment. I interact with these people over a long period of time and in a direct way. The primary group that many people are part of is the family. A secondary group is one that I don’t interact with as much. My interactions with them are more impersonal. One such group would be my coworkers.
In-groups are groups that I identify with, and particularly those with which I identify quite strongly. This makes them similar to primary groups, though secondary groups can fit here as well. Out-groups are groups that I do not like. I try to distance myself from them. In fact, I even tend to define my own group in opposition to them. They are the people who are not like me.
Thus, primary and secondary groups and in-groups are groups to which I am connected in some positive way. By contrast, out-groups are groups that I do not like and do not want to be a part of.