Young adult vs adult fiction isn't about the age of the characters (though that usually does vary too), it's about the age of your readers.
If you're writing for adults, then write for adults and pitch your work that way to publishers, agents, and potential customers.
If you use a traditional publisher, they might want to classify your book as young adult, or not. And you can work that out directly with them.
Young adult fiction can have adult elements. Sex, violence, relationships, drugs, death, etc are all fair game. Ultimately though, it's about who you envision reading the book. This will change how you use those elements. A young adult novel is unlikely to have all of the elements or put them as in-your-face as, say, A Song of Ice and Fire does.
The difference is also about point of view. Through whose eyes are you seeing the events? Looking again at Game of Thrones (the first book in the series A Song of Ice and Fire), the child viewpoint chapters are very different from the adult viewpoint chapters. We the readers know it's a disturbing and dangerous world mostly because of the adult chapters. The kids are not exactly shielded from things (look at Bran's early chapters) but they don't see the big picture and they don't really understand what they do see.
You and your publisher will make this classification decision based on all these factors and others (like how the marketing winds are blowing). If a bookstore chooses a different classification, that's on them. You have no say. But the official classification generally holds (in libraries, in most stores, in online searches, etc).