Well...
When you enter the Aqua hideout for the submarine, you should have explored the hideout to find the masterball in Archie's office.
If you left the hideout before finding it and Archie summoned Kyogre, you're in trouble.
So you need to get it in the first opportunity you've got, RSE isn't nice unlike other games where either someone hands you the Master Ball or someone calls you to get it.
You find it in the team aqua hideout.
In team aqua's hideout
you will find one in team aqua's hideout
theres one materball in team magma/aqua hideout
get the masterball inthe hideout of team aqua then find latios
You get it in team aqua's hideout near lilycove. You need a Pokemon that knows surf to get to the hideout. Another way to get masterball are hack and cheats
In department stroe or in team aqua hideout
you are supposed to beat team aqua to get into in team aqua's hideout you are supposed to beat team aqua to get into team aqua's hideout in lilycove city
battle all team aqua
you go to mount. chimney go down the side and a new cave will open up and it is a team magma hide out when you beat them go to saleport then when team aqua takes the submarine got back to team aqua hideout and beat them then they will go away also team aqua hideout is where you get a masterball
after getting into team magmas hideout
You can find team aqua's hideout in the east side of Lilycove City in Pokémon Sapphire.