There are two ways to do this:
- Create a temporary path between them and then do a union operation on the path.
- Combine the paths into a single object, and then connect a pair of nodes between them to create a single path.
Method 1: Union
- Draw a temporary object between the two.
It doesn't have to be perfect (in the image below, it's yellow). This object will get destroyed later. Turning on node snapping can make this process easier.
- Holding the Shift key, select one of your objects, and then select the temporary object you created.
- On the Path menu, click Union.
- Repeat with the second object.
Method 2: Connect nodes
- Holding the Shift key, select the two objects to be connected.
- On the Path menu, click Combine.
- Using the Node tool F2, select the path between two nodes on one object.
You are going to un-connect these nodes and then connect them to nodes on the other object.
- On the toolbar, click the Delete segment between two non-endpoint nodes button.
Do the same with the path on the other object.
Holding the Shift key, select a node on one side of each object.
You are going to connect these nodes.
- On the toolbar, click the Join selected end nodes with a new segment button.
While it may look like you're done, the two nodes on the opposite side still need to be connected.
- Repeat with the two nodes on the other side.
Alternative: Saving the two original objects
If your goal isn't to combine the two paths into one connected path but rather to create a 3rd object between then, then you can still follow the method below. Just duplicate Ctrl + D the two objects first before connecting them, then send it to the back once you're done. If you truly want a 3rd object that only fills the space between them, use the Division operation, similar to how you used Union above.
I would actually recommend not doing that two. Paths that but up against each other in SVG images are sometimes rendered as having a gap between them. It's a good idea to have some overlap.