You don't *really* need rectangles. This can be done with 3 stroked paths in Illustrator....

[![enter image description here][1]][1]

- Draw 1 path 
- Apply a thick stroke
- Apply a stroke profile (On the Stroke Panel) so the stroke narrows at one end.
- Duplicate the path
- Change the stroke color
- Adjust the anchors slightly so they are offset a bit from the original
- Duplicate the path again for 3rd stroke
- Tweak 3rd stroke anchors and color

Really you just need to draw 1 path. You *could* use the black stroked path in your second image as a starting point.

--------------

*Technically* if one makes the base stroke super, super, thick, this *could* be accomplished with just 2 overlapping strokes....

[![enter image description here][2]][2]

------------------

Or .. slightly more advanced.... 1 path with multiple strokes using the **Appearance Panel** and the **Width Tool** to add some variation to the thinner stroke.

[![enter image description here][3]][3]

------------------

If you then *want* filled shapes rather than strokes...

Select all and then choose `Object > Expand Appearance` from the menu.

[![enter image description here][4]][4]

`Object > Path > Simplify...` can be helpful after expanding, to eliminate a lot of superfluous anchor points.

[![enter image description here][5]][5]


  [1]: https://i.sstatic.net/EpdGx.png
  [2]: https://i.sstatic.net/zsXGW.png
  [3]: https://i.sstatic.net/bxkng.png
  [4]: https://i.sstatic.net/nFi3F.png
  [5]: https://i.sstatic.net/sqVvJ.png