Are the two example questions correct or is there a rule that applies when using and not using contraction words?
- "weren't you able to log into your online account?"
- "were not you able to log into your online account?"
Although -n't was originally a clitic, a reduced form of not, in Present-Day English it has become an inflectional suffix that attaches to auxiliary verbs. In other words, the negative auxiliary weren't is a single word, and it undergoes subject–auxiliary inversion like any other auxiliary:
1a. You weren't able to log into your online account.
1b. Weren't you able to log into your online account?
In example 1a the main clause is declarative. In example 1b, the subject you is inverted with the negative auxiliary weren't, marking the main clause as interrogative.
If you start with an uncontracted example, not doesn't move; it's a separate word and not part of the auxiliary:
2a. You were not able to log into your online account.
2b. Were you not able to log into your online account?
Again, in example 2a the main clause is declarative. In example 2b, the subject you is inverted with the auxiliary were, marking the main clause as interrogative.
Not cannot move with were:
3. *Were not you able to log into your online account? (ungrammatical)
This example is ungrammatical in Present-Day English, but it's a common mistake among English language learners.
Note that if the subject noun phrase is particularly "heavy" (lengthy or syntactically complex), it can be moved to the right of its basic position, reuniting the auxiliary and negator after inversion, but that doesn't apply in your example, as the subject you is not particularly heavy.
In speech, the contraction would be the everyday version. The full version would be used for emphasis of the negative, and stressed to match...
It would also move... 'were not you' just doesn't work.
"Weren't you able to log into your online account?" is light & colloquial. The contraction placing were & not together is acceptable & commonplace.
"Were not you able to log into your online account?" is grammatically incorrect.
"Were you not able to log into your online account?" would be the more formal expression, though in speech emphasises the inability - perhaps with an element of disbelief that something so apparently simple could not be achieved.
The same rules would apply to couldn't/could not.