I think this website will be very useful to your learning curve…..
https://www.sheldonbrown.com/wheelbuild.html
Sheldon does not explicitly talk about motorized hubs but that is mostly irrelevant to what you want to do; just treat the hub like it’s got big flanges and shorter spokes. And once you find rims that work for you the swap is slightly easier than a new build as you can lay the new rim over the old one and just move the spokes over following the same pattern.