Don't think its a spoiler butuntil you do the quest that says "This action will make an enemy of x faction", you can do quests for all 4 factions. I did Minutemen and it was a little confusing in how to get the end game quests to kick off.
Battle for Bunker Hill was a 3 way battle for me too but you can pretty much walk through and decide which faction you want to help if any. For the Institute, you're supposed to use the reset codes and the courser teleports back with them. I killed my courser right away and then told the 4 they were free to go but they still appeared as objectives until I spoke to Father. Even if you mess up that quest for the Institue, I believe you can explain your actions to Father and still continue with Institute if you wish.
I couldn't initiate the end game quests for the Minutemen until I got myself kicked out of the Institute. I did that after the Battle of Bunker Hill when I explained to Father he was crazy. Alternatively, you can get kicked out by attacking/killing Father/Institute Scientists while at the Institute
Man Bethesda has always kinda sucked at narrative but they really dropped the ball on this one.