If you are talking specifically about doing it to a rectangle, you must convert it to curves first (Ctrl+Q or Arrange menu or right click menu). Shapes like ellipses and rectangles have specific characteristics and can not be edited like "normal" objects. Anyway, to remove two sides like that, select the Shape tool from the toolbox (double clicking the object will automatically switch to Shape tool), click on a segment (a "star" will appear) and delete it (right click and Delete will also work). The second line can be deleted the same way or by selecting the end node and delete. These instructions will guide you in the right direction, keep playing with it and you'll find out how it works. Come back if you have additional questions.