Easy-peasy ...
1 - drag out rectangle and define fills, strokes and so forth ...
2 - draw out dividing line
3 - select both objects (rectangle and dividing line)
4 - open up layers panel to ensure line is above rectangle
5 - with both objects selected and suitably ordered select Object > Path Operations > Divide
6 - confirm division in layers panel