How can I add a custom primitive object
Go to File > User Preferences > Add-ons and search for Add Mesh: Extra Objects and enable it.

Make sure to Save User Settings to keep it that way.





Shift+A > Mesh > Round Cube to add this object from the add-on.





In the Tool Shelf or after pressing F6 select Operator Presets and choose Capsule.
Switch Type to Edges - this will allow to control horizontal edge loops.




Now you can control capsule Radius, Length (by changing Z value), subdivision (Arc and Linear).