I think you are confusing Standard Visitor Visa with leave to enter.
As an EU citizen you don't need a Standard Visitor Visa, which must be applied for before you enter the United Kingdom as a visitor.
When you enter the United Kingdom, Immigration will decide to grant a leave to enter for a specific amount of time. When you leave, this leave becomes invalid.
When you return, Immigration will, again, decide to grant a leave to enter for a specific amount of time (or not).
The decision will be based on the circumstances known to them.
When you first enter, you should inform them of your intensionsintentions:
- planingplanning to stay alltogeatheraltogether for around 4 months, but returning in August for about 3 weeks
They may, or may not, make a note of this statement. If they do, the immigration officer will not be surprised when you return in August. (They don't like surprises).