One D6 is thrown for each element in range and able to fire. Such an element can fire once only at one target element in each turn.
There is no overhead fire allowed, unless it is Artillery firing from a hill (who can still only fire over friendly units) and never over woods, hills or buildings.
No shooting is allowed through a gap less than one element's base width wide, or from troops that are in HTH.
No shooting is allowed from troops within woods or a BUA if they are over 1 inch from the edge and are attempting to shoot at troops outside the terrain. All troops within such terrain firing at troops within the same terrain area have a range of only 2 inches.
No element can shoot while in a river.
Artillery cannot shoot unless deployed, or at any enemy within 1 inch of a friendly unit.
The arc of fire for Foot is 20 degrees either side of an element's front edge, but 360 degrees for a unit in square with an individual element's arc measured from the centre of the square through its own rear corners.
Artillery's firing arc cannot exceed 3 inches from its own, or its battery's centre line.

A could shoot at E.
B could shoot at E or F.
C could shoot at F or G.
D could shoot at G.
A and B cannot shoot through the gap between E and F.
C can shoot at G because F is not 'blocking' over half of its sight of G.

A and D can fire at each other because D is within 1 inch of the edge of the BUA.
C can fire at D as they are 2 inches apart and both within the BUA.
B cannot fire at D as it is outside the terrain and also D is over 1 inch away from the BUA's edge relative to B.

The ranges for different troop types and the modified score required to cause a hit are shown below. Note that Cavalry cannot fire.

Heavy Cavalry - -
Light Cavalry - -
Heavy Foot 8" 6
Light Foot
(if have rifles)
Both Types
Line of Sight
within 8"
up to maximum
up to maximum
5, 6
5, 6 v column
4, 5, 6 v square