The full picture
Ne stands for di + something or a counted noun; ci stands for a place or a + something.
| ne + amount | Ne ho due. · Quanti ne hai? · Non ne ho. |
| ne = of / about it | Che ne pensi? · Ne parliamo domani. |
| ci = there | Ci vado domani. · Ci sono stato. |
| ci = on / about it | Ci penso io. · Ci credi? |
| it takes | ci vuole un’ora · ci vogliono due ore |
| ci → ce | ce l’ho · ce li ho · ce le ho · ce ne sono tanti |
Counting ne makes the participle agree: ne ho mangiate tre (pizze).
Both go before the verb, or onto the end of an infinitive: ci devo andare = devo andarci.
Before lo, la, li, le and ne, ci becomes ce.