That's how I wished the ranger's animal companion had been designed; not so much as an extra fighter but as a mobile mechanics giving PCs a variety of different options. It isn't far from what I'd like it to be, but I know I'm in a minority as to what I think the animal companion should be. But I digress...
5e proposes many models to take after. If anything, it's one of the annoying thing about running PC-controlled animals; there are way to many models.
There's the familiar approach - low hp, acts on its own on its own initiative count, provides limited battlefield control, and a cheap way for the character to gain the help action.
There is the PHB beastmaster approach - higher hp, requires you to use your action to command, acts on your initiative count, can make an attack as one of your own when you take the attack action. Better at battlefield control (leave it next to a baddy, let use its default dodge action, let it make an AoO if the baddy moves). Unfortunately, it doesn't have enough hp and is too hard to replace to do that consistently.
There is the revised beastmaster approach - animal is basically an extra (weaker) PC controlled by you
There is the revised revised beastmaster approach (which is like the artificer steel defender IIRC) - a tad more hp that the PHB version and easier to replace, uses your bonus action to command, acts on your initiative count, otherwise similar to PHB version in capacity.
It seems that you are aiming for a mastiff as an extension of the character more than as an extra PC. So PHB beastmaster and Eberron Battle Smith's steel defender models work best. Commanding the mastiff as an action conflicts with the fighter's advantage at higher level; 3 or 4 attacks per Attack action. Therefore, I'd suggest you to explore the steel defender approach.
Let's see what it could look like:
3rd level: Gain mastiff. Copy steel defenders stats, use mastiff from PHB as a base (page 307), or make you own stat block. Stats increase with PC's proficiency bonus. Acts on PC's initiative after PC. Use your bonus action to command an action such as help; otherwise takes dodge. Select one or two tricks from a list (trip on a hit, gain pack tactics, grant help when it attacks, make extra attack when pounces and trips, gains mobility, gains disadvantage on AoO against it, gains advantage on AoO against enemies, gains evasion, barks at invisible creatures it can smell, etc)
7th: Mastiff can make an attack using one of your own attacks. Mastiff can now use Dash, Disengage, or Help when not given a command. Select a new trick.
10th: When mastiff is reduced to 0 hp, it drops to 1 hp instead.
15th: When you use second wind, your mastiff heals too.
18th: when you take action surge, the mastiff take another round too.
Needs (a lot) of polishing, but that's the way I'd go.