At the bottom of the task group screen, there should be a minimum distance setting. That might explain why you cannot get within 50k kilometers. You also need to consider the speed of your ships and your opponents'. If they're faster than you, you'll never be able to get within 50k kilometers.
You cannot give a task-group wide attack command, nor would you want to. There is an auto-fire option, which has poor target prioritization. It very often picks terrible targets though. For instance, if you're trying to maintain a set distance from your foes, you use a follow command based on one of the contacts, with a minimum distance set such that you can stay at your desired range. But then the auto-targeter targets and kills the one you're set to follow, your ships stop, and suddenly they're right on top of you.
To set your ships up, and perform combat, you want to go to the combat menu. Its the orange crosshairs button on the main screen. I think everything in there is pretty self-explanatory, but if you have any questions, I'd be happy to help.