Ok so drones have three "modes" that they operate in. It's called the Control Hierarchy:
Local/Pilot control*: You command the drone by verbally telling it what to do, like it was a well trained dog or something. "Shoot anyone who comes through that door" or "go to this address and loiter there. Alert me if this guy we're looking for shows up there." You don't roll any dice... if the drone has to make a test it rolls Pilot + relevant Autosoft. it has its own initiative score and uses its actions to execute your verbal commands outside of your own actions during combat. There's no limit on the number of drones you can have running under Pilot control. Well, I guess the limit is how many drones you can afford to buy...
Remote control: The drone is a tool under your direct control, but you're not IN it (in the case of a vehicle). If you want to maneuver a drone through a tricky passageway, or shoot someone, you roll YOUR attribute + skill. During combat, the drone technically has its own initiative score but it's a formality. While under remote control the pilot/autopilot is suppressed and does nothing on its own initiative scores. The initiative score only matters because one of the actions YOU can take is to release it back to Pilot control, at which case the aforementioned tier comes back in play. You can only have one drone under Remote Control at a time.
Jumped in: Everyone can do the prior two ways of controlling a drone. Only riggers (and TMs who buy the right power) can Jump In. While jumped in, you use your own stats/skills and the drone still doesn't do anything on its own. This tier is like remote control, but you HAVE to be in VR and this tier trumps remote control (just as remote control trumps pilot/manual control). This means that while jumped in, it's impossible for an enemy hacker to hijack your drone. It (well, technically your Persona) can be bricked of course, but the drone can't be HIJACKED as there is no control hierarchy tier higher than Jumped In. And naturally you can only be Jumped Into one drone at a time.
*EDIT: yeah, yeah. Vehicles' Manual Control hierarchy tier is technically below the pilot tier. But drones don't even have a manual control option in the manner of vehicles, so let's not get TOO far into the weeds.
If you jump in, you are in VR. Rules on exactly when you use physical vs mental attribute are a bit fuzzy in SR5, can't remember from top of my head.
If you remote-command, you either use Control Device with your own actual roll (which rules say uses Agility for attacking, even though that's rubbish if you're in VR...), or give a command and let the drone handle it. If the Drone Autopilot is doing the work, THEN Autosofts are used.
I do remember my Rigger player being really annoyed back when we started with 5E about this, because IIRC you always use your physical Agility RAW.
That's one of the things that actually never got fixed in 5e. By RAW you use Agility. But in another part of the book, by RAW you use Logic. The conflict never got errata published. Even in SRM the fundamental question of "Well do Riggers need AGI or LOG to use their drones?" went unanswered. The policy was "just let them use whichever attribute is better".