There are two ways you can think about this.
One way is Shimano's way, that pulling spokes should be on the outside (spoke on the outside, head on the inside). This means on rim brake front wheels, it doesn't matter as spokes don't pull. Whatever is easiest for the wheel builder will be the best way to do it (more about the easiness later). However on disc brake front wheels, the spokes on the left flange and on the right flange should be mirror images of each other if looked at from the outside, because both flanges transmit braking force and braking force only. On the left flange, the braking force is a clockwise load and on the right flange, the braking force is a counterclockwise load. The left side transmits most of the braking force, but because front brake braking force is very substantial, a lot of it is transmitted via the right flange as well.
On disc brake rear wheels, the left side transmits braking force primarily, whereas the right side transmits pedaling force primarily. Thus, both flanges see clockwise loads. Therefore, both flanges should have the same spoke pattern if looked at from the outside.
On rim brake rear wheels, the right flange transmits pedaling force primarily, but a very small part of the pedaling force actually goes via the left flange. There is no braking load at the hub. Thus, the left flange transmits counterclockwise loads and the right flange transmits clockwise loads. For this reason, rim brake rear wheels are ideally spoked as a mirror image of disc brake front wheels. However, the pedaling loads on the left flange are very small so the left flange shouldn't matter much anyway.
The other way is to consider the easiness of the wheel building. It's easier to first install spokes on the inside (heads on the outside), because the later step of installing the other spokes will have the spokes on the outside so the installation work is greatly reduced because you can freely place the outside spokes in the final location with no interference from the existing spokes. In contrast, if you install the outside spokes first and only then the inside spokes, you won't have as much space on the inside of the wheel to freely place the spokes in the final location.
If building wheels according to the bible, the first spoke to be installed will be a right side spoke. It's easiest to make it be an inside spoke. For rim brake front wheels it doesn't matter. For disc brake front wheels it will be a pushing spoke for braking loads so making it an inside spoke is optimal. For rear wheels, it will be a pulling spoke on pedaling loads so strictly speaking it should perhaps be an outside spoke according to Shimano's way.
The second set (on the left flange) is begun with a spoke in the same direction. For disc brake front wheels the second set is begun with a pushing spoke for braking loads so beginning with an inside spoke is optimal. Similarly disc brake rear wheels it will be a pushing spoke for braking loads so beginning with an inside spoke is optimal. For rim brake rear wheels, a very tiny amount of pedaling force goes via the left flange and it will be a pulling force for pedaling forces so strictly speaking it should perhaps be put on the outside. But the pedaling forces the left flange sees will be very minimal so that's not a major problem.
However, a lot of wheels have been built according to those instructions by Sheldon Brown. Such wheels don't have a high failure rate despite the fact that the rear wheels don't have the spokes that will be pulling spokes for pedaling loads optimally oriented.
So, whether you follow Shimano or Sheldon Brown, the front wheel will be the same anyway. For rear wheels, Shimano vs Sheldon Brown disagree on the right side spokes -- Sheldon Brown is easier to implement but Shimano might have a slightly better durability especially if you are one of those who thinks it's a good idea to purchase a 85 Nm mid-drive e-bike, put a 20-tooth chainring and a cassette with a 51-tooth sprocket, put as much load on the bicycle as you can and pull a trailer with heavy stones in it, and repeatedly accelerate up the steepest hill you can find, pedaling standing with the highest assist level.
The Sheldon Brown left side spokes will be ideal for disc brake rear wheels but not perfect for rim brake rear wheels but the pedaling forces on the left flange are so small that they probably don't have any durability difference in any real-life application.