Whenever Dire Fleet Captain attacks, it gets +1/+1 until end of turn for each other attacking Pirate.
Count the number of other attacking Pirates as the ability resolves to determine the size of the bonus.
In a Two-Headed Giant game, attacking Pirates controlled by your teammate will count for Dire Fleet Captain’s ability.
Once the ability resolves, the bonus won’t change later in the turn, even if the number of other attacking Pirates does.