How do I make sure that all the task of a sub-projects are also visible under the main project ?
unfortunately, that's not possible right now. You can collapse the main project and it will display the number of total tasks within it, but it will not display all tasks within the whole structure, but just within this one project.
We will consider adding such feature in the future, though. You're welcome to vote for this request: http://todoist.com/Vote/showProposal/33/